diff options
author | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:48 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:48 (GMT) |
commit | 4f5c6a27d84ea72d00510e0a9c9f8e69db17a765 (patch) | |
tree | 0395afb94ef62eaa7371a1c395437a1f90b534b4 /Lib/test/test_socket.py | |
parent | aaa67862e87479699779ac6903f35f1848b97968 (diff) | |
parent | 625fb648f7287b024f0cf762d04ce9224a6b7d31 (diff) | |
download | cpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.zip cpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.tar.gz cpython-4f5c6a27d84ea72d00510e0a9c9f8e69db17a765.tar.bz2 |
Issue #28815: Merge test tweak from 3.6
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 10 |
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 "): |