diff options
author | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:18 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:18 +0000 |
commit | cb8f22240a150d4f20c5816eb4bd68a1e2ac0bf3 (patch) | |
tree | 3e9efeb6a35301af69c0546f4e9bb36e0e974e73 /Lib | |
parent | 0b95f201b7f904a8749eed20390e2b8164616c94 (diff) | |
parent | cf680bdb83bcbc2babb822c60eacb425b94e4eb8 (diff) | |
download | cpython-cb8f22240a150d4f20c5816eb4bd68a1e2ac0bf3.tar.gz |
Issue #28815: Merge test tweak from 3.5
Diffstat (limited to 'Lib')
-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 92e727d640..97dc3cd76b 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 "): |