diff options
| author | Stefan Zimmermann <zimmermann.code@gmail.com> | 2014-03-31 15:13:02 (GMT) |
|---|---|---|
| committer | Stefan Zimmermann <zimmermann.code@gmail.com> | 2014-03-31 15:13:02 (GMT) |
| commit | 1a1a11122ad28df19d305af879ba79a2b08ce7d4 (patch) | |
| tree | 4464eb544fe0cc698ea4d1c5789e19770b83cd6f /src/engine/SCons/Script | |
| parent | 9f36c5b899b8d2d54cae8d3da76b01308c144ed6 (diff) | |
| download | SCons-1a1a11122ad28df19d305af879ba79a2b08ce7d4.zip SCons-1a1a11122ad28df19d305af879ba79a2b08ce7d4.tar.gz SCons-1a1a11122ad28df19d305af879ba79a2b08ce7d4.tar.bz2 | |
Made former 2to3 changes Python 2.7 compatible (or removed unneeded changes).
Diffstat (limited to 'src/engine/SCons/Script')
| -rw-r--r-- | src/engine/SCons/Script/Interactive.py | 5 | ||||
| -rw-r--r-- | src/engine/SCons/Script/Main.py | 7 | ||||
| -rw-r--r-- | src/engine/SCons/Script/SConsOptions.py | 2 | ||||
| -rw-r--r-- | src/engine/SCons/Script/SConscript.py | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py index 87fe1cf..0b28f1a 100644 --- a/src/engine/SCons/Script/Interactive.py +++ b/src/engine/SCons/Script/Interactive.py @@ -19,6 +19,7 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import print_function __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -120,7 +121,7 @@ class SConsInteractiveCmd(cmd.Cmd): def __init__(self, **kw): cmd.Cmd.__init__(self) - for key, val in list(kw.items()): + for key, val in kw.items(): setattr(self, key, val) if sys.platform == 'win32': @@ -249,7 +250,7 @@ class SConsInteractiveCmd(cmd.Cmd): while n: n = walker.get_next() - for node in list(seen_nodes.keys()): + for node in seen_nodes.keys(): # Call node.clear() to clear most of the state node.clear() # node.clear() doesn't reset node.state, so call diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 9a52937..584960b 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -10,6 +10,8 @@ some other module. If it's specific to the "scons" script invocation, it goes here. """ +from __future__ import print_function + unsupported_python_version = (2, 3, 0) deprecated_python_version = (2, 7, 0) @@ -68,7 +70,6 @@ import SCons.Util import SCons.Warnings import SCons.Script.Interactive -import collections def fetch_win32_parallel_msg(): # A subsidiary function that exists solely to isolate this import @@ -105,7 +106,7 @@ class Progressor(object): self.interval = interval self.overwrite = overwrite - if isinstance(obj, collections.Callable): + if callable(obj): self.func = obj elif SCons.Util.is_List(obj): self.func = self.spinner @@ -716,7 +717,7 @@ def _load_site_scons_dir(topdir, site_dir_name=None): modname = os.path.basename(pathname)[:-len(sfx)] site_m = {"__file__": pathname, "__name__": modname, "__doc__": None} re_special = re.compile("__[^_]+__") - for k in list(m.__dict__.keys()): + for k in m.__dict__.keys(): if not re_special.match(k): site_m[k] = m.__dict__[k] diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 559db97..a97fc94 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -611,7 +611,7 @@ def Parser(version): deprecated_debug_options=deprecated_debug_options): if value in debug_options: parser.values.debug.append(value) - elif value in list(deprecated_debug_options.keys()): + elif value in deprecated_debug_options.keys(): parser.values.debug.append(value) try: parser.values.delayed_warnings diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 05cb6a6..b2dc4c1 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -26,7 +26,7 @@ files. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +from __future__ import division, print_function __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -529,7 +529,7 @@ class SConsEnvironment(SCons.Environment.Base): return x ls = list(map(subst_element, ls)) subst_kw = {} - for key, val in list(kw.items()): + for key, val in kw.items(): if SCons.Util.is_String(val): val = self.subst(val) elif SCons.Util.is_List(val): |
