summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Environment.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-03-31 12:28:33 (GMT)
committerSteven Knight <knight@baldmt.com>2004-03-31 12:28:33 (GMT)
commitb421b8da6d7925aaffe347c49d8851cb166e922e (patch)
tree7a3f03918de6d86f5aaa737e576288d3d063702f /src/engine/SCons/Environment.py
parent1d77f7097830acce939fcaa8315ae659f1ecc7dd (diff)
downloadSCons-b421b8da6d7925aaffe347c49d8851cb166e922e.zip
SCons-b421b8da6d7925aaffe347c49d8851cb166e922e.tar.gz
SCons-b421b8da6d7925aaffe347c49d8851cb166e922e.tar.bz2
Avoid infinite recursion when comparing Environments, better sys.version use in src/setup/Tests.py.
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r--src/engine/SCons/Environment.py10
1 files changed, 9 insertions, 1 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]