From bed419a0423c2e4bf386bb79f57d98a078c968b0 Mon Sep 17 00:00:00 2001 From: GregNoel Date: Mon, 22 Sep 2008 08:28:28 +0000 Subject: [PATCH] Fix syntax and semantic errors preventing regression tests from running on 1.5.2 git-svn-id: http://scons.tigris.org/svn/scons/trunk@3450 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Scanner/LaTeX.py | 18 ++++++++++-------- src/engine/SCons/Tool/tex.py | 6 ++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py index c5441088..30845054 100644 --- a/src/engine/SCons/Scanner/LaTeX.py +++ b/src/engine/SCons/Scanner/LaTeX.py @@ -126,16 +126,17 @@ class LaTeX(SCons.Scanner.Base): """ def __init__(self, dictionary): self.dictionary = {} - for k, n in dictionary.iteritems(): + for k,n in dictionary.items(): self.dictionary[k] = SCons.Scanner.FindPathDirs(n) - def __call__(self, env, dir=None, target=None, source=None, argument=None): + + def __call__(self, env, dir=None, target=None, source=None, + argument=None): di = {} - for k, c in self.dictionary.iteritems(): - p = c(env, dir=None, target=None, source=None, argument=None) - di[k] = p + for k,c in self.dictionary.items(): + di[k] = c(env, dir=None, target=None, source=None, + argument=None) # To prevent "dict is not hashable error" - rv = tuple([(k,v) for k, v in di.iteritems()]) - return rv + return tuple(di.items()) class LaTeXScanCheck: """Skip all but LaTeX source files, i.e., do not scan *.eps, @@ -177,7 +178,8 @@ class LaTeX(SCons.Scanner.Base): if include[0] == 'includegraphics': base, ext = os.path.splitext( filename ) if ext == "": - return [filename + e for e in self.graphics_extensions] + #FUTURE return [filename + e for e in self.graphics_extensions] + return map(lambda e, f=filename: f+e, self.graphics_extensions) return [filename] def sort_key(self, include): diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py index 59980e5c..72d925bb 100644 --- a/src/engine/SCons/Tool/tex.py +++ b/src/engine/SCons/Tool/tex.py @@ -128,10 +128,12 @@ def modify_env_var(env, var, abspath): env.PrependENVPath(var, abspath) try: if SCons.Util.is_List(env[var]): - env.PrependENVPath(var, [os.path.abspath(str(p)) for p in env[var]]) + #FUTURE env.PrependENVPath(var, [os.path.abspath(str(p)) for p in env[var]]) + env.PrependENVPath(var, map(lambda p: os.path.abspath(str(p)), env[var])) else: # Split at os.pathsep to convert into absolute path - env.PrependENVPath(var, [os.path.abspath(p) for p in str(env[var]).split(os.pathsep)]) + #FUTURE env.PrependENVPath(var, [os.path.abspath(p) for p in str(env[var]).split(os.pathsep)]) + env.PrependENVPath(var, map(lambda p: os.path.abspath(p), str(env[var]).split(os.pathsep))) except KeyError: pass # Convert into a string explicitly to append ":" (without which it won't search system -- 2.26.2