From b8e138aa238e23e9b3e53e012cd4e0b54ec28022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Sat, 4 Jul 2009 15:16:38 +0000 Subject: Revert last change, which was incorrect. --- Lib/socketserver.py | 7 +------ Lib/test/test_sys.py | 2 -- Modules/_multiprocessing/win32_functions.c | 6 ++++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 37df2ba..e5f5778 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -445,12 +445,7 @@ class TCPServer(BaseServer): def close_request(self, request): """Called to clean up an individual request.""" - 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.shutdown(socket.SHUT_WR) request.close() diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 8986741..cac90f4 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -182,8 +182,6 @@ 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: diff --git a/Modules/_multiprocessing/win32_functions.c b/Modules/_multiprocessing/win32_functions.c index 379a495..ba82c23 100644 --- a/Modules/_multiprocessing/win32_functions.c +++ b/Modules/_multiprocessing/win32_functions.c @@ -130,6 +130,12 @@ 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; -- cgit v0.12