]> granicus.if.org Git - python/commitdiff
http://bugs.python.org/issue6381
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 4 Jul 2009 15:09:25 +0000 (15:09 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 4 Jul 2009 15:09:25 +0000 (15:09 +0000)
merging revision 73819 from trunk

Lib/socketserver.py
Lib/test/test_sys.py
Modules/_multiprocessing/win32_functions.c

index e5f5778872fe96ea526240c3b25bf415f13aae80..37df2bab33c76defea38af64bf9ecf65b17f4c35 100644 (file)
@@ -445,7 +445,12 @@ class TCPServer(BaseServer):
 
     def close_request(self, request):
         """Called to clean up an individual request."""
-        request.shutdown(socket.SHUT_WR)
+        try:
+            #explicitly shutdown.  socket.close() merely releases
+            #the socket and waits for GC to perform the actual close.
+            request.shutdown(socket.SHUT_WR)
+        except socket.error:
+            pass #some platforms may raise ENOTCONN here
         request.close()
 
 
index cac90f4dc979e280bd607f19799604965f52b2ea..898674175733a29c3f6228fcef96586870a87748 100644 (file)
@@ -182,6 +182,8 @@ class SysModuleTest(unittest.TestCase):
                 "under Windows, test would generate a spurious crash dialog")
         code = textwrap.dedent("""
             import sys
+            import msvcrt
+            msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS)
 
             def f():
                 try:
index ba82c23517c1c8da90472f201073b761a96e8b28..379a49515e37e02d5e14957d9454165f2a9c8283 100644 (file)
@@ -130,12 +130,6 @@ win32_ExitProcess(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "I", &uExitCode))
                return NULL;
 
-       #if defined(Py_DEBUG)
-               SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX);
-               _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
-       #endif
-
-
        ExitProcess(uExitCode);
 
        return NULL;