aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/test
diff options
context:
space:
mode:
authorGravatar Rohan Jain <rohanj@google.com>2016-09-08 19:43:48 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-09-08 20:47:26 -0700
commit56ad910f5957d3aa2d96eb840e6da36ac4105236 (patch)
treeaaa201e3593af8e7baad551c5c8b7f1d92d7c5ba /tensorflow/tools/test
parent8016cf4ab1e2ff3c3c5448e539b9ec89d5a0bcd4 (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/tools/test')
-rw-r--r--tensorflow/tools/test/gpu_info_lib.py5
-rw-r--r--tensorflow/tools/test/system_info_lib.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/tensorflow/tools/test/gpu_info_lib.py b/tensorflow/tools/test/gpu_info_lib.py
index 047a4f11fd..f29ff9af24 100644
--- a/tensorflow/tools/test/gpu_info_lib.py
+++ b/tensorflow/tools/test/gpu_info_lib.py
@@ -26,6 +26,7 @@ import platform
import tensorflow as tf
from tensorflow.core.util import test_log_pb2
+from tensorflow.python.framework import errors
def _gather_gpu_devices_proc():
@@ -174,11 +175,11 @@ def gather_gpu_devices():
if not dev_info:
raise ValueError("No devices found")
return dev_info
- except (IOError, ValueError):
+ except (IOError, ValueError, errors.OpError):
pass
try:
# Fall back on using libcudart
return _gather_gpu_devices_cudart()
- except (OSError, ValueError, NotImplementedError):
+ except (OSError, ValueError, NotImplementedError, errors.OpError):
return []
diff --git a/tensorflow/tools/test/system_info_lib.py b/tensorflow/tools/test/system_info_lib.py
index 2f10342d4a..0ef108faea 100644
--- a/tensorflow/tools/test/system_info_lib.py
+++ b/tensorflow/tools/test/system_info_lib.py
@@ -35,6 +35,7 @@ import psutil
from tensorflow.core.util import test_log_pb2
from tensorflow.python.client import device_lib
+from tensorflow.python.framework import errors
from tensorflow.tools.test import gpu_info_lib
@@ -85,7 +86,7 @@ def gather_cpu_info():
if nc: # e.g. 'ff' => 8, 'fff' => 12
cpu_info.num_cores_allowed = (
bin(int(nc.group(1).replace(',', ''), 16)).count('1'))
- except IOError:
+ except errors.OpError:
pass
finally:
if cpu_info.num_cores_allowed == 0:
@@ -112,7 +113,7 @@ def gather_cpu_info():
cpu_info.cpu_governor = 'mixed'
else:
cpu_info.cpu_governor = list(cpu_governors)[0]
- except IOError:
+ except errors.OpError:
pass
return cpu_info