summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik M. Bray <erik.bray@lri.fr>2016-09-27 14:54:10 +0200
committerErik M. Bray <erik.bray@lri.fr>2016-09-27 17:47:56 +0200
commited3f43d3d1eadc897c24f1ac6589d4b63da62189 (patch)
treed671be4be4ca93d92f5dac3451b69e976357b4e1
parentdc7cd0e36b70149e7b7dad173048b185750d891e (diff)
downloadpsutil-ed3f43d3d1eadc897c24f1ac6589d4b63da62189.tar.gz
On Python 2 IOError is not a subclass of OSError, so catch both explicitly
-rw-r--r--psutil/tests/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 219760be..a90e785c 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -387,7 +387,7 @@ def wait_for_file(fname, timeout=GLOBAL_TIMEOUT, delete_file=True):
if delete_file:
os.remove(fname)
return data
- except OSError:
+ except (IOError, OSError):
time.sleep(0.001)
raise RuntimeError(
"timed out after %s secs (couldn't read file)" % timeout)