]> granicus.if.org Git - python/commitdiff
getpid doesn't exist on MacOS9.
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 21 Feb 2003 22:29:45 +0000 (22:29 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 21 Feb 2003 22:29:45 +0000 (22:29 +0000)
Lib/logging/__init__.py

index 18fe37962af281774fc870889bf540159224031c..12a40b029a5e7ef1072c69c1f0dfdd92dd386025 100644 (file)
@@ -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,