diff options
author | 2016-09-08 19:43:48 -0800 | |
---|---|---|
committer | 2016-09-08 20:47:26 -0700 | |
commit | 56ad910f5957d3aa2d96eb840e6da36ac4105236 (patch) | |
tree | aaa201e3593af8e7baad551c5c8b7f1d92d7c5ba /tensorflow/python/summary/impl/directory_watcher.py | |
parent | 8016cf4ab1e2ff3c3c5448e539b9ec89d5a0bcd4 (diff) |
Redirecting gfile to file_io.
Also, changed the return type of FileIO.readline(), FileIO.readlines(), list_directories() and walk() to be strings rather than bytes.
Change: 132634441
Diffstat (limited to 'tensorflow/python/summary/impl/directory_watcher.py')
-rw-r--r-- | tensorflow/python/summary/impl/directory_watcher.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/python/summary/impl/directory_watcher.py b/tensorflow/python/summary/impl/directory_watcher.py index 5ed80d7348..56a08b11ea 100644 --- a/tensorflow/python/summary/impl/directory_watcher.py +++ b/tensorflow/python/summary/impl/directory_watcher.py @@ -20,6 +20,7 @@ from __future__ import print_function import bisect +from tensorflow.python.framework import errors from tensorflow.python.platform import tf_logging as logging from tensorflow.python.summary.impl import gcs from tensorflow.python.summary.impl import io_wrapper @@ -86,7 +87,7 @@ class DirectoryWatcher(object): try: for event in self._LoadInternal(): yield event - except (IOError, OSError): + except errors.OpError: if not io_wrapper.Exists(self._directory): raise DirectoryDeletedError( 'Directory %s has been permanently deleted' % self._directory) @@ -183,7 +184,7 @@ class DirectoryWatcher(object): size = io_wrapper.Size(old_path) logging.debug('Setting latest size of %s to %d', old_path, size) self._finalized_sizes[old_path] = size - except (IOError, OSError) as e: + except errors.OpError as e: logging.error('Unable to get size of %s: %s', old_path, e) self._path = path |