cpython: 41a99a2a7198 (original) (raw)
Mercurial > cpython
changeset 105817:41a99a2a7198 2.7
Issue #28815: Skip TIPC tests if /proc/modules is not readable Based on patch by Patrila. [#28815]
Martin Panter vadmium+py@gmail.com | |
---|---|
date | Sat, 24 Dec 2016 10:41:37 +0000 |
parents | d63a11bd98ce |
children | 878a91174e74 |
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 @@ -1707,9 +1707,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