summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2009-10-16 14:06:44 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2009-10-16 14:06:44 (GMT)
commit96d4aa3fca0b5001f5e346dd836f9c48e5954dbb (patch)
tree63beeb95ca647e12af770f2a8e2376158cd4d774 /Lib/logging
parent42e30556e56947a83130165be3bcac1d2707c8cd (diff)
downloadcpython-96d4aa3fca0b5001f5e346dd836f9c48e5954dbb.zip
cpython-96d4aa3fca0b5001f5e346dd836f9c48e5954dbb.tar.gz
cpython-96d4aa3fca0b5001f5e346dd836f9c48e5954dbb.tar.bz2
Issue #7120: logging: Removed import of multiprocessing which is causing crash in GAE.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 033fecd..e64d86b 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -284,12 +284,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: