diff options
| author | Steven Knight <knight@baldmt.com> | 2006-04-01 11:30:40 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2006-04-01 11:30:40 (GMT) |
| commit | f4f080107ba2bfdab4bffbc7e243c6228f4acd88 (patch) | |
| tree | 2f7812957ecd562c1a41f3620121c474fde5cef5 /src/engine/SCons/Debug.py | |
| parent | b77fd3655cda2e277d7859d981a2759fce75ada4 (diff) | |
| download | SCons-f4f080107ba2bfdab4bffbc7e243c6228f4acd88.zip SCons-f4f080107ba2bfdab4bffbc7e243c6228f4acd88.tar.gz SCons-f4f080107ba2bfdab4bffbc7e243c6228f4acd88.tar.bz2 | |
Fix directory separators to allow the Debug.caller() function to strip unnecessary parts of path names on Windows.
Diffstat (limited to 'src/engine/SCons/Debug.py')
| -rw-r--r-- | src/engine/SCons/Debug.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/engine/SCons/Debug.py b/src/engine/SCons/Debug.py index cc97fe0..1cff9c6 100644 --- a/src/engine/SCons/Debug.py +++ b/src/engine/SCons/Debug.py @@ -31,10 +31,11 @@ needed by most users. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -# Recipe 14.10 from the Python Cookbook. +import os import string import sys + +# Recipe 14.10 from the Python Cookbook. try: import weakref except ImportError: @@ -152,6 +153,12 @@ shorten_list = [ ( '/usr/lib/python', 0), ] +if os.sep != '/': + def platformize(t): + return (string.replace(t[0], '/', os.sep), t[1]) + shorten_list = map(platformize, shorten_list) + del platformize + def func_shorten(func_tuple): f = func_tuple[0] for t in shorten_list: |
