summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/exitfuncs.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2012-12-21 04:59:23 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2012-12-21 04:59:23 (GMT)
commitf4edb08a4af66043bab63386d9c03b2be7c37875 (patch)
treee5f5d9f6ca6157f58e531d4894998d6c04c9853d /src/engine/SCons/exitfuncs.py
parentb646c1c4a6d4825a03798ac610c3cb6d37bdbe02 (diff)
parentfeaeef3be77d66989f55c183618164b783b1ddee (diff)
downloadSCons-f4edb08a4af66043bab63386d9c03b2be7c37875.zip
SCons-f4edb08a4af66043bab63386d9c03b2be7c37875.tar.gz
SCons-f4edb08a4af66043bab63386d9c03b2be7c37875.tar.bz2
Merged in techtonik/scons (pull request #63: Another minor cleanup as the code study goes on)
Diffstat (limited to 'src/engine/SCons/exitfuncs.py')
-rw-r--r--src/engine/SCons/exitfuncs.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/engine/SCons/exitfuncs.py b/src/engine/SCons/exitfuncs.py
index 250dd54..7d00df7 100644
--- a/src/engine/SCons/exitfuncs.py
+++ b/src/engine/SCons/exitfuncs.py
@@ -30,6 +30,7 @@ Register functions which are executed when SCons exits for any reason.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import atexit
_exithandlers = []
def _run_exitfuncs():
@@ -52,23 +53,9 @@ def register(func, *targs, **kargs):
"""
_exithandlers.append((func, targs, kargs))
-import sys
-try:
- x = sys.exitfunc
-
- # if x isn't our own exit func executive, assume it's another
- # registered exit function - append it to our list...
- if x != _run_exitfuncs:
- register(x)
-
-except AttributeError:
- pass
-
-# make our exit function get run by python when it exits:
-sys.exitfunc = _run_exitfuncs
-
-del sys
+# make our exit function get run by python when it exits
+atexit.register(_run_exitfuncs)
# Local Variables:
# tab-width:4