diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-29 05:50:15 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-29 05:50:15 (GMT) |
commit | 7adebb06bb6055345cc584377159d8052ea39e1b (patch) | |
tree | d0ca5f58b87d964927a1db7f4fe8a602f8405d23 /src/engine/SCons/compat/__init__.py | |
parent | 59ed0a109bf5add2efcef459080837b11066c6fb (diff) | |
download | SCons-7adebb06bb6055345cc584377159d8052ea39e1b.zip SCons-7adebb06bb6055345cc584377159d8052ea39e1b.tar.gz SCons-7adebb06bb6055345cc584377159d8052ea39e1b.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Accumulated small fixers: renames, next, zip, and intern.
Files that were modified or added while developing on branches/pending didn't
have the fixers previously applied. This patchset picks up those.
Diffstat (limited to 'src/engine/SCons/compat/__init__.py')
-rw-r--r-- | src/engine/SCons/compat/__init__.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index d959518..49c317c 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -117,7 +117,7 @@ except AttributeError: import os,posixpath result=[] pat = os.path.normcase(pat) - if not fnmatch._cache.has_key(pat): + if pat not in fnmatch._cache: import re res = fnmatch.translate(pat) fnmatch._cache[pat] = re.compile(res) @@ -269,15 +269,8 @@ try: sys.maxsize except AttributeError: # Pre-2.6 Python has no sys.maxsize attribute - sys.maxsize = sys.maxint -try: - sys.version_info -except AttributeError: - # Pre-1.6 Python has no sys.version_info - import string - version_string = string.split(sys.version)[0] - version_ints = map(int, string.split(version_string, '.')) - sys.version_info = tuple(version_ints + ['final', 0]) + # Wrapping sys in () is silly, but protects it from 2to3 renames fixer + sys.maxsize = (sys).maxint try: import UserString @@ -308,7 +301,7 @@ except AttributeError: flags = flags | os.O_BINARY while True: try : - name = apply(tempfile.mktemp, args, kw) + name = tempfile.mktemp(*args, **kw) fd = os.open( name, flags, 0600 ) return (fd, os.path.abspath(name)) except OSError, e: |