summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-08 01:06:18 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2017-01-08 01:06:18 (GMT)
commit625fb648f7287b024f0cf762d04ce9224a6b7d31 (patch)
tree5b2a715c1f98bb8ce228e3c6c8a1b31c80648089 /Lib/test/test_socket.py
parent0b64a0fc6468eb0abaf04a3e666c7a16f6b373f1 (diff)
parent8cbd46f19ffa8b1ac7220fcd1c791ab4cade8e10 (diff)
downloadcpython-625fb648f7287b024f0cf762d04ce9224a6b7d31.zip
cpython-625fb648f7287b024f0cf762d04ce9224a6b7d31.tar.gz
cpython-625fb648f7287b024f0cf762d04ce9224a6b7d31.tar.bz2
Issue #28815: Merge test tweak from 3.5
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 92e727d..97dc3cd 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4780,14 +4780,10 @@ def isTipcAvailable():
return False
try:
f = open("/proc/modules")
- except IOError as e:
+ except (FileNotFoundError, IsADirectoryError, PermissionError):
# It's ok if the file does not exist, is a directory or if we
- # have not the permission to read it. In any other case it's a
- # real error, so raise it again.
- if e.errno in (errno.ENOENT, errno.EISDIR, errno.EACCES):
- return False
- else:
- raise
+ # have not the permission to read it.
+ return False
with f:
for line in f:
if line.startswith("tipc "):