summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-08 01:06:48 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2017-01-08 01:06:48 (GMT)
commit4f5c6a27d84ea72d00510e0a9c9f8e69db17a765 (patch)
tree0395afb94ef62eaa7371a1c395437a1f90b534b4
parentaaa67862e87479699779ac6903f35f1848b97968 (diff)
parent625fb648f7287b024f0cf762d04ce9224a6b7d31 (diff)
downloadcpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.zip
cpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.tar.gz
cpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.tar.bz2
Issue #28815: Merge test tweak from 3.6
-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 b902633..b5c9c0c 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4798,14 +4798,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 "):