Commit ad06444d authored by Richard Oudkerk's avatar Richard Oudkerk

Make Finalize reserve a reference to os.getpid in case called at shutdown

parent 9650d364
......@@ -170,7 +170,7 @@ class Finalize(object):
# Need to bind these locally because the globals can have
# been cleared at shutdown
_finalizer_registry=_finalizer_registry,
sub_debug=sub_debug):
sub_debug=sub_debug, getpid=os.getpid):
'''
Run the callback unless it has already been called or cancelled
'''
......@@ -179,7 +179,7 @@ class Finalize(object):
except KeyError:
sub_debug('finalizer no longer registered')
else:
if self._pid != os.getpid():
if self._pid != getpid():
sub_debug('finalizer ignored because different process')
res = None
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment