diff options
author | Steven Knight <knight@baldmt.com> | 2008-10-15 14:36:07 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2008-10-15 14:36:07 (GMT) |
commit | 594f48886dfb67c4c2d232561007583bbceb3238 (patch) | |
tree | b9d3ef546ef37acbcf5523e00ecb4931fb624f85 /src/engine/SCons/Script/SConscript.py | |
parent | 96edb2c80e97965974608eb143500353425f8d8e (diff) | |
download | SCons-594f48886dfb67c4c2d232561007583bbceb3238.zip SCons-594f48886dfb67c4c2d232561007583bbceb3238.tar.gz SCons-594f48886dfb67c4c2d232561007583bbceb3238.tar.bz2 |
Fix use of VariantDir when the -n option is used and doesn't,
therefore, actually create the variant directory.
Diffstat (limited to 'src/engine/SCons/Script/SConscript.py')
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 5cfde64..4119a3b 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -279,7 +279,20 @@ def _SConscript(fs, *files, **kw): fs.chdir(frame.prev_dir, change_os_dir=0) rdir = frame.prev_dir.rdir() rdir._create() # Make sure there's a directory there. - os.chdir(rdir.get_abspath()) + try: + os.chdir(rdir.get_abspath()) + except OSError, e: + # We still couldn't chdir there, so raise the error, + # but only if actions are being executed. + # + # If the -n option was used, the directory would *not* + # have been created and we should just carry on and + # let things muddle through. This isn't guaranteed + # to work if the SConscript files are reading things + # from disk (for example), but it should work well + # enough for most configurations. + if SCons.Action.execute_actions: + raise e results.append(frame.retval) |