Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbce202

Browse files
committed
Hack to workaround bug #445984: attempt to import _socket before
starting the test suite proper. If _socket fails to build, that will make this test fail with an ImportError -- handled by the test harness as "no such module _socket" -- instead of an AttributeError deep in CGIHTTPServer.
1 parent 60fc707 commit cbce202

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test___all__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ def check_all(modname):
3838
all.sort()
3939
verify(keys==all, "%s != %s" % (keys, all))
4040

41+
# In case _socket fails to build, make this test fail more gracefully
42+
# than an AttributeError somewhere deep in CGIHTTPServer.
43+
import _socket
44+
4145
check_all("BaseHTTPServer")
4246
check_all("CGIHTTPServer")
4347
check_all("ConfigParser")

0 commit comments

Comments
 (0)