summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-02-21 22:29:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-02-21 22:29:45 (GMT)
commit4c641d0ce1cc764f300e8c6863eaaf37c956a8d2 (patch)
tree29e60cd782619c1fd9329da6688f71e4a7a4b45c
parentbe53242f49f4f40c372a5300db1d8ad5ac06ffe8 (diff)
downloadcpython-4c641d0ce1cc764f300e8c6863eaaf37c956a8d2.zip
cpython-4c641d0ce1cc764f300e8c6863eaaf37c956a8d2.tar.gz
cpython-4c641d0ce1cc764f300e8c6863eaaf37c956a8d2.tar.bz2
getpid doesn't exist on MacOS9.
-rw-r--r--Lib/logging/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 18fe379..12a40b0 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -213,7 +213,10 @@ class LogRecord:
self.thread = thread.get_ident()
else:
self.thread = None
- self.process = os.getpid()
+ if hasattr(os, 'getpid'):
+ self.process = os.getpid()
+ else:
+ self.process = None
def __str__(self):
return '<LogRecord: %s, %s, %s, %s, "%s">'%(self.name, self.levelno,