diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-15 01:06:53 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-15 01:06:53 (GMT) |
commit | d58dff5877e75c3c7813045a075e50b23ecb1dfd (patch) | |
tree | 61feaa168910aa37ebbd6a9018792b7470a8c944 /src/engine | |
parent | 9931fe6c59d330d0dbeea1c51456e3a9f94377d8 (diff) | |
download | SCons-d58dff5877e75c3c7813045a075e50b23ecb1dfd.zip SCons-d58dff5877e75c3c7813045a075e50b23ecb1dfd.tar.gz SCons-d58dff5877e75c3c7813045a075e50b23ecb1dfd.tar.bz2 |
Refactor use of basestring to use exec() on attempted assignment of
basestring to an internal variable (which we thenuse in a common
is_basestring() utility function), to avoid triggering the basestring fixer.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/compat/_scons_shlex.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/engine/SCons/compat/_scons_shlex.py b/src/engine/SCons/compat/_scons_shlex.py index 6ed39cf..2a748ff 100644 --- a/src/engine/SCons/compat/_scons_shlex.py +++ b/src/engine/SCons/compat/_scons_shlex.py @@ -23,14 +23,13 @@ class deque: return self.data.pop(0) try: - basestring + # exec() the assignment to avoid the basestring fixer. + exec('_basestring = basestring') except NameError: import types - def is_basestring(s): - return isinstance(s, str) -else: - def is_basestring(s): - return isinstance(s, basestring) + _basestring = str +def is_basestring(s): + return isinstance(s, _basestring) # Use the "imp" module to protect the imports below from fixers. try: |