diff options
author | ndbecker2 <ndbecker2@gmail.com> | 2013-09-09 14:39:46 (GMT) |
---|---|---|
committer | ndbecker2 <ndbecker2@gmail.com> | 2013-09-09 14:39:46 (GMT) |
commit | 8473d8293b056663f8a3caf04550039b18690a70 (patch) | |
tree | 3f627c270ed4633109a1572ed64b49931027823f | |
parent | 0727ee61d6ec6eeb099b0d179fa77a1a86046ee8 (diff) | |
download | SCons-8473d8293b056663f8a3caf04550039b18690a70.zip SCons-8473d8293b056663f8a3caf04550039b18690a70.tar.gz SCons-8473d8293b056663f8a3caf04550039b18690a70.tar.bz2 |
minor cleanup
(transplanted from 4feb1b15eb7a0c76cb020e09817c509a782d45b7)
-rw-r--r-- | src/engine/SCons/Action.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Util.py | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 7a97dae..66757a4 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -434,12 +434,7 @@ class ActionBase(object): def get_contents(self, target, source, env): result = [ self.get_presig(target, source, env) ] - def clean (u): - if isinstance (u, bytes): - return u - elif isinstance (u, str): - return bytes (u, 'utf-8') - result = [ clean(r) for r in result ] + result = [ SCons.Util.to_bytes(r) for r in result ] # This should never happen, as the Action() factory should wrap # the varlist, but just in case an action is created directly, # we duplicate this check here. diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 00fde6c..0c4daff 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -1486,7 +1486,7 @@ class NullSeq(Null): del __revision__ def to_bytes (s): - if bytes is str: + if isinstance (s, bytes) or bytes is str: return s else: return bytes (s, 'utf-8') |