cpython: 48b9d9cdfe3b (original) (raw)
Mercurial > cpython
changeset 105815:48b9d9cdfe3b 3.6
Issue #28815: Merge test_socket fix from 3.5 [#28815]
Martin Panter vadmium+py@gmail.com | |
---|---|
date | Sat, 24 Dec 2016 10:53:18 +0000 |
parents | ef53ef8e09e5(current diff)7889d7a771c7(diff) |
children | 7ceacac48cd2 4663466b0d66 |
files | Lib/test/test_socket.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-)[+] [-] Lib/test/test_socket.py 14 |
line wrap: on
line diff
--- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4778,9 +4778,17 @@ def isTipcAvailable(): """ if not hasattr(socket, "AF_TIPC"): return False
- try:
f = open("/proc/modules")[](#l1.11)
- except IOError as e:
# It's ok if the file does not exist, is a directory or if we[](#l1.13)
# have not the permission to read it. In any other case it's a[](#l1.14)
# real error, so raise it again.[](#l1.15)
if e.errno in (errno.ENOENT, errno.EISDIR, errno.EACCES):[](#l1.16)
return False[](#l1.17)
else:[](#l1.18)
raise[](#l1.19)
- with f: for line in f: if line.startswith("tipc "): return True