diff options
Diffstat (limited to 'src/engine/SCons/Subst.py')
-rw-r--r-- | src/engine/SCons/Subst.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 115f7db..2a993be 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -29,11 +29,13 @@ SCons string substitution. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import __builtin__ +import SCons.compat + import re import string import types import UserList +import UserString import SCons.Errors @@ -121,17 +123,15 @@ def quote_spaces(arg): else: return str(arg) -class CmdStringHolder(SCons.Util.UserString): +class CmdStringHolder(UserString.UserString): """This is a special class used to hold strings generated by scons_subst() and scons_subst_list(). It defines a special method escape(). When passed a function with an escape algorithm for a particular platform, it will return the contained string with the proper escape sequences inserted. - - This should really be a subclass of UserString, but that module - doesn't exist in Python 1.5.2.""" + """ def __init__(self, cmd, literal=None): - SCons.Util.UserString.__init__(self, cmd) + UserString.UserString.__init__(self, cmd) self.literal = literal def is_literal(self): @@ -497,18 +497,18 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={ lvars.update(d) # We're (most likely) going to eval() things. If Python doesn't - # find a __builtin__ value in the global dictionary used for eval(), - # it copies the current __builtin__ values for you. Avoid this by + # find a __builtins__ value in the global dictionary used for eval(), + # it copies the current global values for you. Avoid this by # setting it explicitly and then deleting, so we don't pollute the # construction environment Dictionary(ies) that are typically used # for expansion. - gvars['__builtin__'] = __builtin__ + gvars['__builtins__'] = __builtins__ ss = StringSubber(env, mode, target, source, conv, gvars) result = ss.substitute(strSubst, lvars) try: - del gvars['__builtin__'] + del gvars['__builtins__'] except KeyError: pass @@ -784,8 +784,8 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gv lvars.update(d) # We're (most likely) going to eval() things. If Python doesn't - # find a __builtin__ value in the global dictionary used for eval(), - # it copies the current __builtin__ values for you. Avoid this by + # find a __builtins__ value in the global dictionary used for eval(), + # it copies the current global values for you. Avoid this by # setting it explicitly and then deleting, so we don't pollute the # construction environment Dictionary(ies) that are typically used # for expansion. |