From 56ad910f5957d3aa2d96eb840e6da36ac4105236 Mon Sep 17 00:00:00 2001 From: Rohan Jain Date: Thu, 8 Sep 2016 19:43:48 -0800 Subject: 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 --- tensorflow/tools/test/gpu_info_lib.py | 5 +++-- tensorflow/tools/test/system_info_lib.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'tensorflow/tools/test') 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 -- cgit v1.2.3