]> granicus.if.org Git - python/commitdiff
Issue #7120: logging: Removed import of multiprocessing which is causing crash in...
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 16 Oct 2009 14:06:44 +0000 (14:06 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 16 Oct 2009 14:06:44 +0000 (14:06 +0000)
Lib/logging/__init__.py
Misc/NEWS

index 0be6ed4b74d84ebb5fd65611493690d5d7c27884..f85296d8665534b49a3f9fe12a9db3e2683802f0 100644 (file)
@@ -287,12 +287,10 @@ class LogRecord:
             self.threadName = None
         if not logMultiprocessing:
             self.processName = None
+        elif 'multiprocessing' not in sys.modules:
+            self.processName = 'MainProcess'
         else:
-            try:
-                from multiprocessing import current_process
-                self.processName = current_process().name
-            except ImportError:
-                self.processName = None
+            self.processName = sys.modules['multiprocessing'].current_process().name
         if logProcesses and hasattr(os, 'getpid'):
             self.process = os.getpid()
         else:
index 0e85ba08a7547331d25a90f0fd3118715b62c5bf..2ac0d9f8212f19ffa5ba0d6cdde5b99c03d5dcd3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
 Core and Builtins
 -----------------
 
+- Issue #7120: logging: Removed import of multiprocessing which is causing
+  crash in GAE.
+
 - Issue #7140: The __dict__ of a module should not be cleared unless the module
   is the only object holding a reference to it.
 
@@ -412,18 +415,18 @@ Library
 
 - Add support to the `ihooks` module for relative imports.
 
-- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment 
+- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment
 
 - Issue #7086: Added TCP support to SysLogHandler, and tidied up some
   anachronisms in the code which were a relic of 1.5.2 compatibility.
-  
+
 - Issue #7082: When falling back to the MIME 'name' parameter, the
   correct place to look for it is the Content-Type header.
 
 - Issue #7048: Force Decimal.logb to round its result when that result
   is too large to fit in the current precision.
 
-- Issue #6516: Added owner/group support when creating tar archives in 
+- Issue #6516: Added owner/group support when creating tar archives in
   Distutils.
 
 - Issue #7031: Add TestCase.assert(Not)IsInstance() methods.
@@ -1292,11 +1295,11 @@ Tools/Demos
 Build
 -----
 
-- Add 2 new options to ``--with-universal-archs`` on MacOSX: 
+- Add 2 new options to ``--with-universal-archs`` on MacOSX:
   ``intel`` builds a distribution with ``i386`` and ``x86_64`` architectures,
-  while ``3-way`` builds a distribution with the ``ppc``, ``i386`` 
-  and ``x86_64`` architectures. 
-  
+  while ``3-way`` builds a distribution with the ``ppc``, ``i386``
+  and ``x86_64`` architectures.
+
 - Issue #6802: Fix build issues on MacOSX 10.6
 
 - Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
@@ -1356,12 +1359,12 @@ Documentation
   for Windows.
 
 - Issue #6801 : symmetric_difference_update also accepts |.
-  Thanks to Carl Chenet. 
+  Thanks to Carl Chenet.
 
 C-API
 -----
 
-- Issue #6624: PyArg_ParseTuple with "s" format when parsing argument with 
+- Issue #6624: PyArg_ParseTuple with "s" format when parsing argument with
   NULL: Bogus TypeError detail string.
 
 - Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of