diff options
| author | Ludwig Hähne <pankrat@tigris.org> | 2008-09-10 16:24:15 (GMT) |
|---|---|---|
| committer | Ludwig Hähne <pankrat@tigris.org> | 2008-09-10 16:24:15 (GMT) |
| commit | 1c280140f557190a9625397bbe9e5a3a540efac5 (patch) | |
| tree | 481d1b99880d2a2d4bf3470fca80032eaa237597 /src/engine/SCons/Script/SConscript.py | |
| parent | 311e482d13e4bfbcd643e0fb7cdc017ac55b6dc9 (diff) | |
| download | SCons-1c280140f557190a9625397bbe9e5a3a540efac5.zip SCons-1c280140f557190a9625397bbe9e5a3a540efac5.tar.gz SCons-1c280140f557190a9625397bbe9e5a3a540efac5.tar.bz2 | |
Issue 2149: Avoid reference cycles caused by frame objects
Diffstat (limited to 'src/engine/SCons/Script/SConscript.py')
| -rw-r--r-- | src/engine/SCons/Script/SConscript.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 7e38ffd..5cfde64 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -81,7 +81,10 @@ def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" try: 1/0 - except ZeroDivisionError: frame = sys.exc_info()[2].tb_frame + except ZeroDivisionError: + # Don't start iterating with the current stack-frame to + # prevent creating reference cycles (f_back is safe). + frame = sys.exc_info()[2].tb_frame.f_back # Find the first frame that *isn't* from this file. This means # that we expect all of the SCons frames that implement an Export() |
