Kaydet (Commit) 7b4fc17c authored tarafından Fred Drake's avatar Fred Drake

Revise to use atexit instead of monkeying with sys.exitfunc directly.

üst def00384
......@@ -462,11 +462,8 @@ class _MainThread(Thread):
_active_limbo_lock.acquire()
_active[_get_ident()] = self
_active_limbo_lock.release()
try:
self.__oldexitfunc = _sys.exitfunc
except AttributeError:
self.__oldexitfunc = None
_sys.exitfunc = self.__exitfunc
import atexit
atexit.register(self.__exitfunc)
def _set_daemon(self):
return 0
......@@ -480,10 +477,6 @@ class _MainThread(Thread):
while t:
t.join()
t = _pickSomeNonDaemonThread()
if self.__oldexitfunc:
if __debug__:
self._note("%s: calling exit handler", self)
self.__oldexitfunc()
if __debug__:
self._note("%s: exiting", self)
self._Thread__delete()
......
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