diff options
author | Steven Knight <knight@baldmt.com> | 2004-03-31 12:28:33 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-03-31 12:28:33 (GMT) |
commit | 67b6df08052c27473b85bfe5c7a39b3f730573ea (patch) | |
tree | 7a3f03918de6d86f5aaa737e576288d3d063702f | |
parent | 9700bc6b12a6320ead9f325a209f29c588f11b02 (diff) | |
download | SCons-67b6df08052c27473b85bfe5c7a39b3f730573ea.zip SCons-67b6df08052c27473b85bfe5c7a39b3f730573ea.tar.gz SCons-67b6df08052c27473b85bfe5c7a39b3f730573ea.tar.bz2 |
Avoid infinite recursion when comparing Environments, better sys.version use in src/setup/Tests.py.
-rw-r--r-- | src/engine/SCons/Environment.py | 10 | ||||
-rw-r--r-- | src/setupTests.py | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 8f576f5..62650d7 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -260,7 +260,15 @@ class Base: options.Update(self) def __cmp__(self, other): - return cmp(self._dict, other._dict) + # Since an Environment now has an '__env__' construction variable + # that refers to itself, delete that variable to avoid infinite + # loops when comparing the underlying dictionaries in some Python + # versions (*cough* 1.5.2 *cough*)... + sdict = self._dict.copy() + del sdict['__env__'] + odict = other._dict.copy() + del odict['__env__'] + return cmp(sdict, odict) def __getitem__(self, key): return self._dict[key] diff --git a/src/setupTests.py b/src/setupTests.py index a098745..06688af 100644 --- a/src/setupTests.py +++ b/src/setupTests.py @@ -71,9 +71,8 @@ root = test.workpath('root') prefix = test.workpath('prefix') lib_dir = os.path.join(root + sys.prefix, 'lib') -v = string.split(string.split(sys.version)[0], '.') standard_lib = os.path.join(lib_dir, - 'python%s.%s' % (v[0], v[1]), + 'python%s' % sys.version[:3], 'site-packages/') standalone_lib = os.path.join(lib_dir, 'scons') version_lib = os.path.join(lib_dir, scons_version) |