mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
getpid doesn't exist on MacOS9.
This commit is contained in:
parent
be53242f49
commit
4c641d0ce1
1 changed files with 4 additions and 1 deletions
|
|
@ -213,7 +213,10 @@ def __init__(self, name, level, pathname, lineno, msg, args, exc_info):
|
|||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue