summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Scanner
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-04-24 05:51:13 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-04-24 05:51:13 (GMT)
commit7e116b31182749950856c622ca7932031f8be19c (patch)
treea4b9f900e52561a91e0c4509dc6c692492996b7f /src/engine/SCons/Scanner
parent591b78f0f314f11192fdf13d3baa66f81b160e44 (diff)
downloadSCons-7e116b31182749950856c622ca7932031f8be19c.zip
SCons-7e116b31182749950856c622ca7932031f8be19c.tar.gz
SCons-7e116b31182749950856c622ca7932031f8be19c.tar.bz2
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Comb out all code that supported earlier versions of Python. Most such code is in snippets of only a few lines and can be identified by having a Python version string in it. Such snippets add up; this combing pass probably got rid of over 500 lines of code.
Diffstat (limited to 'src/engine/SCons/Scanner')
-rw-r--r--src/engine/SCons/Scanner/Dir.py2
-rw-r--r--src/engine/SCons/Scanner/Fortran.py2
-rw-r--r--src/engine/SCons/Scanner/LaTeX.py26
-rw-r--r--src/engine/SCons/Scanner/ScannerTests.py11
4 files changed, 8 insertions, 33 deletions
diff --git a/src/engine/SCons/Scanner/Dir.py b/src/engine/SCons/Scanner/Dir.py
index f02904f..1cecfb7 100644
--- a/src/engine/SCons/Scanner/Dir.py
+++ b/src/engine/SCons/Scanner/Dir.py
@@ -19,8 +19,6 @@
# 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 generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py
index 74f44bc..29af9aa 100644
--- a/src/engine/SCons/Scanner/Fortran.py
+++ b/src/engine/SCons/Scanner/Fortran.py
@@ -25,8 +25,6 @@ This module implements the dependency scanner for Fortran code.
# 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 generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py
index 904d612..9ea450b 100644
--- a/src/engine/SCons/Scanner/LaTeX.py
+++ b/src/engine/SCons/Scanner/LaTeX.py
@@ -57,12 +57,9 @@ def modify_env_var(env, var, abspath):
env.PrependENVPath(var, abspath)
try:
if SCons.Util.is_List(env[var]):
- #TODO(1.5)
- #env.PrependENVPath(var, [os.path.abspath(str(p)) for p in env[var]])
env.PrependENVPath(var, [os.path.abspath(str(p)) for p in env[var]])
else:
# Split at os.pathsep to convert into absolute path
- #TODO(1.5) env.PrependENVPath(var, [os.path.abspath(p) for p in str(env[var]).split(os.pathsep)])
env.PrependENVPath(var, [os.path.abspath(p) for p in str(env[var]).split(os.pathsep)])
except KeyError:
pass
@@ -72,8 +69,6 @@ def modify_env_var(env, var, abspath):
# does not work, refuses to append ":" (os.pathsep).
if SCons.Util.is_List(env['ENV'][var]):
- # TODO(1.5)
- #env['ENV'][var] = os.pathsep.join(env['ENV'][var])
env['ENV'][var] = os.pathsep.join(env['ENV'][var])
# Append the trailing os.pathsep character here to catch the case with no env[var]
env['ENV'][var] = env['ENV'][var] + os.pathsep
@@ -251,10 +246,11 @@ class LaTeX(SCons.Scanner.Base):
if include[0] == 'includegraphics':
base, ext = os.path.splitext( filename )
if ext == "":
- #TODO(1.5) return [filename + e for e in self.graphics_extensions]
- #return map(lambda e: filename+e, self.graphics_extensions + TexGraphics)
- # use the line above to find dependency for PDF builder when only .eps figure is present
- # Since it will be found if the user tell scons how to make the pdf figure leave it out for now.
+ #return [filename+e for e in self.graphics_extensions + TexGraphics]
+ # use the line above to find dependencies for the PDF builder
+ # when only an .eps figure is present. Since it will be found
+ # if the user tells scons how to make the pdf figure, leave
+ # it out for now.
return [filename+e for e in self.graphics_extensions]
return [filename]
@@ -335,19 +331,11 @@ class LaTeX(SCons.Scanner.Base):
while queue:
include = queue.pop()
- # TODO(1.5): more compact:
- #try:
- # if seen[include[1]] == 1:
- # continue
- #except KeyError:
- # seen[include[1]] = 1
try:
- already_seen = seen[include[1]]
+ if seen[include[1]] == 1:
+ continue
except KeyError:
seen[include[1]] = 1
- already_seen = False
- if already_seen:
- continue
#
# Handle multiple filenames in include[1]
diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py
index a356308..2e9a72a 100644
--- a/src/engine/SCons/Scanner/ScannerTests.py
+++ b/src/engine/SCons/Scanner/ScannerTests.py
@@ -19,8 +19,6 @@
# 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 generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -571,14 +569,7 @@ class ClassicCPPTestCase(unittest.TestCase):
assert n == 'path/bbb', n
assert i == 'bbb', i
- # TODO(1.5): remove when 2.2 is minimal; replace ccc
- # variable in find_include() call below with in-line u'ccc'.
- try:
- ccc = eval("u'ccc'")
- except SyntaxError:
- ccc = 'ccc'
-
- n, i = s.find_include(('<', ccc), 'foo', ('path',))
+ n, i = s.find_include(('<', u'ccc'), 'foo', ('path',))
assert n == 'path/ccc', n
assert i == 'ccc', i