summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 20:02:39 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 20:02:39 (GMT)
commitad28c7f9dad791567afa0624acfb3ba430851965 (patch)
tree02095e5f567d6be1de31ffd858d21233b51675dd /Lib/test
parenta19195984922ce89e7695c93b3bb45c3e0e6d732 (diff)
downloadcpython-ad28c7f9dad791567afa0624acfb3ba430851965.zip
cpython-ad28c7f9dad791567afa0624acfb3ba430851965.tar.gz
cpython-ad28c7f9dad791567afa0624acfb3ba430851965.tar.bz2
Issue #16706: get rid of os.error
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/sortperf.py2
-rw-r--r--Lib/test/test_socketserver.py2
-rw-r--r--Lib/test/test_tempfile.py4
-rw-r--r--Lib/test/tf_inherit_check.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py
index af7c0b4..a370ed9 100644
--- a/Lib/test/sortperf.py
+++ b/Lib/test/sortperf.py
@@ -35,7 +35,7 @@ def randfloats(n):
if fp:
try:
os.unlink(fn)
- except os.error:
+ except OSError:
pass
except IOError as msg:
print("can't write", fn, ":", msg)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 3dd0d64..84a5e7b 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -82,7 +82,7 @@ class SocketServerTest(unittest.TestCase):
for fn in self.test_files:
try:
os.remove(fn)
- except os.error:
+ except OSError:
pass
self.test_files[:] = []
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index f5193dc..2b8f096 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -188,7 +188,7 @@ class TestCandidateTempdirList(BaseTestCase):
try:
dirname = os.getcwd()
- except (AttributeError, os.error):
+ except (AttributeError, OSError):
dirname = os.curdir
self.assertIn(dirname, cand)
@@ -924,7 +924,7 @@ class TestTemporaryDirectory(BaseTestCase):
# (noted as part of Issue #10188)
with tempfile.TemporaryDirectory() as nonexistent:
pass
- with self.assertRaises(os.error):
+ with self.assertRaises(OSError):
tempfile.TemporaryDirectory(dir=nonexistent)
def test_explicit_cleanup(self):
diff --git a/Lib/test/tf_inherit_check.py b/Lib/test/tf_inherit_check.py
index 92ebd95..afe50d2 100644
--- a/Lib/test/tf_inherit_check.py
+++ b/Lib/test/tf_inherit_check.py
@@ -11,7 +11,7 @@ try:
try:
os.write(fd, b"blat")
- except os.error:
+ except OSError:
# Success -- could not write to fd.
sys.exit(0)
else: