summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-08-07 14:25:15 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2015-08-07 14:25:15 +0200
commit3e5aa8a7646cbe31c88413df51c04c06864e25bf (patch)
treee795fe12fc6aaf4d295addd2e5c3adcfd73d2911
parenta347904947825a2da90422ebe29c437b17cc9f84 (diff)
downloadpsutil-3e5aa8a7646cbe31c88413df51c04c06864e25bf.tar.gz
try to fix failure on py 3
-rw-r--r--test/test_psutil.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_psutil.py b/test/test_psutil.py
index 4afbe08b..ed93330a 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -1514,7 +1514,8 @@ class TestProcess(unittest.TestCase):
with self.assertRaises(IOError) as exc:
with open(TESTFN, "wb") as f:
f.write(b"X" * 1025)
- self.assertEqual(exc.exception[0], errno.EFBIG)
+ self.assertEqual(exc.exception.errno if PY3 else exc.exception[0],
+ errno.EFBIG)
finally:
p.rlimit(psutil.RLIMIT_FSIZE, (soft, hard))
self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard))