From 003453475b4fb0b0b9f9031ed6a10876fa4f7e71 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 15 Apr 2010 01:06:53 +0000 Subject: [PATCH] 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. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4786 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/compat/_scons_shlex.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/compat/_scons_shlex.py b/src/engine/SCons/compat/_scons_shlex.py index 6ed39cfa..2a748ff4 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: -- 2.26.2