diff options
author | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:18 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2017-01-08 01:06:18 (GMT) |
commit | 625fb648f7287b024f0cf762d04ce9224a6b7d31 (patch) | |
tree | 5b2a715c1f98bb8ce228e3c6c8a1b31c80648089 /Lib/test/test_socket.py | |
parent | 0b64a0fc6468eb0abaf04a3e666c7a16f6b373f1 (diff) | |
parent | 8cbd46f19ffa8b1ac7220fcd1c791ab4cade8e10 (diff) | |
download | cpython-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.py | 10 |
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 "): |