diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-06-04 17:58:59 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-06-04 17:58:59 (GMT) |
commit | ad06444d6c52e614a65ee126bc4c916da0c2c57e (patch) | |
tree | 9e07e3d4fad6fffc427329a2b4e60bbbab8178a0 /Lib/multiprocessing/util.py | |
parent | 9650d36498d6d063e0928bea724bd9f119458b30 (diff) | |
download | cpython-ad06444d6c52e614a65ee126bc4c916da0c2c57e.zip cpython-ad06444d6c52e614a65ee126bc4c916da0c2c57e.tar.gz cpython-ad06444d6c52e614a65ee126bc4c916da0c2c57e.tar.bz2 |
Make Finalize reserve a reference to os.getpid in case called at shutdown
Diffstat (limited to 'Lib/multiprocessing/util.py')
-rw-r--r-- | Lib/multiprocessing/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 16ded51..48abe38 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -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: |