summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/cppTests.py3
-rw-r--r--src/engine/SCons/exitfuncs.py19
-rw-r--r--src/os_spawnv_fix.diff83
-rw-r--r--src/test_strings.py2
5 files changed, 7 insertions, 102 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 21984e4..16cfa3a 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -18,6 +18,8 @@ RELEASE 2.X.X -
* replaced `-o FILE --xml` combination with `--xml FILE`
* changed `-o, --output FILE` option to capture stdout/stderr output
from runtest.py
+ - Remove os_spawnv_fix.diff patch required to enable parallel builds
+ support prior to Python 2.2
From Juan Lang:
- Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output
diff --git a/src/engine/SCons/cppTests.py b/src/engine/SCons/cppTests.py
index bfb0b46..2f2025b 100644
--- a/src/engine/SCons/cppTests.py
+++ b/src/engine/SCons/cppTests.py
@@ -23,6 +23,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import atexit
import sys
import unittest
@@ -608,7 +609,7 @@ def _clean():
if os.path.exists(dir):
shutil.rmtree(dir)
-sys.exitfunc = _clean
+atexit.register(_clean)
class fileTestCase(unittest.TestCase):
cpp_class = cpp.DumbPreProcessor
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
diff --git a/src/os_spawnv_fix.diff b/src/os_spawnv_fix.diff
deleted file mode 100644
index 926f896..0000000
--- a/src/os_spawnv_fix.diff
+++ /dev/null
@@ -1,83 +0,0 @@
-? dist/src/Mac/IDE scripts/Hold option to open a script
-? dist/src/Mac/IDE scripts/Insert file name
-? dist/src/Mac/IDE scripts/Insert folder name
-? dist/src/Mac/IDE scripts/Search Python Documentation
-? dist/src/Mac/IDE scripts/Hack/Remove .pyc files
-? dist/src/Mac/IDE scripts/Hack/Toolbox Assistant
-Index: dist/src/Modules/posixmodule.c
-===================================================================
-RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
-retrieving revision 2.213
-diff -c -c -r2.213 posixmodule.c
-*** dist/src/Modules/posixmodule.c 2001/12/03 20:41:00 2.213
---- dist/src/Modules/posixmodule.c 2001/12/05 00:52:58
-***************
-*** 1668,1674 ****
- #ifdef HAVE_SPAWNV
- static char posix_spawnv__doc__[] =
- "spawnv(mode, path, args)\n\
-! Execute an executable path with arguments, replacing current process.\n\
- \n\
- mode: mode of process creation\n\
- path: path of executable file\n\
---- 1668,1674 ----
- #ifdef HAVE_SPAWNV
- static char posix_spawnv__doc__[] =
- "spawnv(mode, path, args)\n\
-! Execute the program 'path' in a new process.\n\
- \n\
- mode: mode of process creation\n\
- path: path of executable file\n\
-***************
-*** 1717,1724 ****
-
- if (mode == _OLD_P_OVERLAY)
- mode = _P_OVERLAY;
- spawnval = _spawnv(mode, path, argvlist);
-!
- PyMem_DEL(argvlist);
-
- if (spawnval == -1)
---- 1717,1727 ----
-
- if (mode == _OLD_P_OVERLAY)
- mode = _P_OVERLAY;
-+
-+ Py_BEGIN_ALLOW_THREADS
- spawnval = _spawnv(mode, path, argvlist);
-! Py_END_ALLOW_THREADS
-!
- PyMem_DEL(argvlist);
-
- if (spawnval == -1)
-***************
-*** 1734,1740 ****
-
- static char posix_spawnve__doc__[] =
- "spawnve(mode, path, args, env)\n\
-! Execute a path with arguments and environment, replacing current process.\n\
- \n\
- mode: mode of process creation\n\
- path: path of executable file\n\
---- 1737,1743 ----
-
- static char posix_spawnve__doc__[] =
- "spawnve(mode, path, args, env)\n\
-! Execute the program 'path' in a new process.\n\
- \n\
- mode: mode of process creation\n\
- path: path of executable file\n\
-***************
-*** 1830,1836 ****
---- 1833,1843 ----
-
- if (mode == _OLD_P_OVERLAY)
- mode = _P_OVERLAY;
-+
-+ Py_BEGIN_ALLOW_THREADS
- spawnval = _spawnve(mode, path, argvlist, envlist);
-+ Py_END_ALLOW_THREADS
-+
- if (spawnval == -1)
- (void) posix_error();
- else
diff --git a/src/test_strings.py b/src/test_strings.py
index a5ba227..3288d5f 100644
--- a/src/test_strings.py
+++ b/src/test_strings.py
@@ -166,7 +166,6 @@ check_list = [
'engine/SCons/Conftest.py',
'engine/SCons/dblite.py',
'MANIFEST',
- 'os_spawnv_fix.diff',
'setup.cfg',
],
# We run epydoc on the *.py files, which generates *.pyc files.
@@ -214,7 +213,6 @@ check_list = [
'QMTest/TestCmdTests.py',
'QMTest/TestCommon.py',
'QMTest/TestCommonTests.py',
- 'src/os_spawnv_fix.diff',
'src/MANIFEST.in',
'src/setup.cfg',
'src/engine/MANIFEST.in',