summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/compat
Commit message (Collapse)AuthorAgeFilesLines
* PY2/3 changes to pickle so py2.7 and py3.5+ pickles used in sconsign will be ↵William Deegan2017-09-111-1/+3
| | | | readable by either. There are still rebuilds when switching
* PY2/3 stub shutil.SameFileError for py2. with PY3 there's now a specific ↵William Deegan2017-05-161-0/+9
| | | | exception for copying a file onto itself. Info about the exception is held in the exception object differently than IOError,etc
* PEP8 fixes.William Deegan2016-09-301-8/+14
|
* use pickle.HIGHEST_PROTOCOL instead of -1Daniel Holth2016-06-211-1/+2
|
* centralize the preferred pickle protocol; use highest protocol.Daniel Holth2016-06-201-0/+5
|
* just throw away __slots__ on pypyDaniel Holth2016-06-071-1/+1
|
* avoid using __slots__ on Node and Executor (but only on PyPy)Daniel Holth2016-06-061-0/+47
|
* Remove all the six stuff.Russel Winder2016-02-022-681/+0
|
* Some more print statements to functions.Russel Winder2016-01-011-2/+2
|
* Run futurize --stage1.Russel Winder2016-01-012-3/+4
|
* Post merge commit for safety. Building Fortran code works, but tests fail.Russel Winder2015-12-247-2248/+34
|\
| * removed several pre-2.7 methods and imports, including some basic refactoringsDirk Baechle2015-12-103-236/+3
| |
| * update logic for sys.intern in compat module. Don't need to support pre 2.7 ↵William Deegan2015-11-191-9/+7
| | | | | | | | anymore
| * remove os.path.lexists from compat module. 2.7 has itWilliam Deegan2015-11-191-7/+0
| |
| * remove sys.maxsize from compat module. 2.7 has itWilliam Deegan2015-11-191-9/+0
| |
| * fix broken cleanup of collections removal from compatWilliam Deegan2015-11-191-0/+29
| |
| * remove compat os.devnull. python 2.7 supports itWilliam Deegan2015-11-191-11/+0
| |
| * remove compat io. python 2.7 supports ioWilliam Deegan2015-11-192-52/+0
| |
| * remove compat collections. python 2.7 supports collectionsWilliam Deegan2015-11-192-71/+0
| |
| * removing compat for sets. python 2.7 supports setsWilliam Deegan2015-11-192-571/+0
| |
| * remove compat module for subprocess. No longer needed as we are only going ↵William Deegan2015-11-192-1287/+0
| | | | | | | | to run on python 2.7.x
* | Added six module as SCons.compat.six, for python3 port.Gary Oberbrunner2014-04-203-1/+681
| |
* | Made former 2to3 changes Python 2.7 compatible (or removed unneeded changes).Stefan Zimmermann2014-03-311-5/+7
| |
* | Result of raw 2to3 run (2to3-2.7); checkpoint for python3 conversion.Gary Oberbrunner2013-09-222-25/+25
|/
* Removed some pre-Python 2.4 compatibility codeanatoly techtonik2012-12-071-43/+0
|
* For some reason, using the `imp` module to do imports doesn't do quite theGreg Noel2010-06-072-21/+11
| | | | | | | | | same thing as using the 'import' statement, even though the documentation clearly says that the 'import' statement uses the 'imp' module under the covers. I have no clue why, but there were some cases where it made a difference. The code was changed to using 'imp' to prevent the fixers from trying to convert the old names to the new names, so this changeset uses a different technique to hide the old names.
* Convert old-style classes in compat/*.py modules to new-style classes.Steven Knight2010-05-163-11/+4
|
* Use slice built-in instead of types.SliceTypeGreg Noel2010-05-011-2/+1
|
* Fix regression tests (imports not happening as expected)Greg Noel2010-04-251-14/+1
|
* Add compat support for renaming '_winreg' as 'winreg' in Python 3.x.Greg Noel2010-04-251-50/+26
|
* Remove the compat version of the "platform" module.Greg Noel2010-04-242-244/+0
|
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-241-17/+2
| | | | | | | 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.
* http://scons.tigris.org/issues/show_bug.cgi?id=2317Greg Noel2010-04-231-1/+1
| | | | | | Apply the refactorings from the 'dict' fixer, less occurrences that were manually audited to be safe. Also pick up changes in bin/sfsum, a Python file that was not being scanned before.
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-211-30/+9
| | | | Apply the 'itertools' and 'itertools_imports' fixers.
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-211-1/+1
| | | | | | Pass the python executable from the -P option to runtest to TestCmd.py. Create the escaped executable name in TestCmd.py as well. Pass those two values into derived test modules. Fix cascade problems in test scripts due to incorrect assumptions about the name of the executable.
* Remove the compat version of the tempfile.mkstemp() function.Steven Knight2010-04-191-35/+0
|
* Remove the compat shutil.move() function.Steven Knight2010-04-191-39/+0
|
* Remove the compat version of the "shlex" module.Steven Knight2010-04-192-345/+0
|
* Remove the compat version of the "textwrap" module.Steven Knight2010-04-192-389/+0
|
* Remove the compat version of the "optparse" module.Steven Knight2010-04-192-1722/+0
|
* Remove the compat version of the "itertools" module.Steven Knight2010-04-192-129/+0
|
* Remove compat fnmatch.filter() support.Steven Knight2010-04-191-28/+0
|
* Index: test/Variables/help.pyGreg Noel2010-04-191-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | =================================================================== --- test/Variables/help.py (revision 4792) +++ test/Variables/help.py (working copy) @@ -28,23 +28,15 @@ Test the Variables help messages. """ -import os.path +import os -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') +import TestSCons str_True = str(True) str_False = str(False) -import TestSCons - test = TestSCons.TestSCons() - - workpath = test.workpath() qtpath = os.path.join(workpath, 'qt') libpath = os.path.join(qtpath, 'lib') Index: test/Variables/PackageVariable.py =================================================================== --- test/Variables/PackageVariable.py (revision 4792) +++ test/Variables/PackageVariable.py (working copy) @@ -28,14 +28,8 @@ Test the PackageVariable canned Variable type. """ -import os.path +import os -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') - import TestSCons test = TestSCons.TestSCons() Index: test/Variables/BoolVariable.py =================================================================== --- test/Variables/BoolVariable.py (revision 4792) +++ test/Variables/BoolVariable.py (working copy) @@ -28,14 +28,8 @@ Test the BoolVariable canned Variable type. """ -import os.path +import os -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') - import TestSCons test = TestSCons.TestSCons() Index: test/Deprecated/Options/help.py =================================================================== --- test/Deprecated/Options/help.py (revision 4792) +++ test/Deprecated/Options/help.py (working copy) @@ -28,24 +28,16 @@ Test the Options help messages. """ -import os.path +import os import re -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') +import TestSCons str_True = str(True) str_False = str(False) -import TestSCons - test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - - workpath = test.workpath() qtpath = os.path.join(workpath, 'qt') libpath = os.path.join(qtpath, 'lib') Index: test/Deprecated/Options/PackageOption.py =================================================================== --- test/Deprecated/Options/PackageOption.py (revision 4792) +++ test/Deprecated/Options/PackageOption.py (working copy) @@ -28,14 +28,8 @@ Test the PackageOption canned Option type. """ -import os.path +import os -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') - import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) Index: test/Deprecated/Options/BoolOption.py =================================================================== --- test/Deprecated/Options/BoolOption.py (revision 4792) +++ test/Deprecated/Options/BoolOption.py (working copy) @@ -28,12 +28,6 @@ Test the BoolOption canned Option type. """ -try: - True, False -except NameError: - exec('True = (0 == 0)') - exec('False = (0 != 0)') - import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) Index: src/script/scons-time.py =================================================================== --- src/script/scons-time.py (revision 4792) +++ src/script/scons-time.py (working copy) @@ -45,13 +45,6 @@ import time try: - True, False -except NameError: - # Pre-2.2 Python has no True or False keyword. - exec('True = not 0') - exec('False = not 1') - -try: sorted except NameError: # Pre-2.4 Python has no sorted() function. Index: src/engine/SCons/compat/_scons_builtins.py =================================================================== --- src/engine/SCons/compat/_scons_builtins.py (revision 4792) +++ src/engine/SCons/compat/_scons_builtins.py (working copy) @@ -37,13 +37,8 @@ all() any() - bool() - dict() sorted() memoryview() - True - False - zip() Implementations of functions are *NOT* guaranteed to be fully compliant with these functions in later versions of Python. We are only concerned @@ -62,22 +57,6 @@ import builtins try: - False -except NameError: - # Pre-2.2 Python has no False keyword. - exec('builtins.False = not 1') - # Assign to False in this module namespace so it shows up in pydoc output. - #False = False - -try: - True -except NameError: - # Pre-2.2 Python has no True keyword. - exec('builtins.True = not 0') - # Assign to True in this module namespace so it shows up in pydoc output. - #True = True - -try: all except NameError: # Pre-2.5 Python has no all() function. @@ -108,42 +87,6 @@ any = any try: - bool -except NameError: - # Pre-2.2 Python has no bool() function. - def bool(value): - """Demote a value to 0 or 1, depending on its truth value. - - This is not to be confused with types.BooleanType, which is - way too hard to duplicate in early Python versions to be - worth the trouble. - """ - return not not value - builtins.bool = bool - bool = bool - -try: - dict -except NameError: - # Pre-2.2 Python has no dict() keyword. - def dict(seq=[], **kwargs): - """ - New dictionary initialization. - """ - d = {} - for k, v in seq: - d[k] = v - d.update(kwargs) - return d - builtins.dict = dict - -try: - file -except NameError: - # Pre-2.2 Python has no file() function. - builtins.file = open - -try: memoryview except NameError: # Pre-2.7 doesn't have the memoryview() built-in. @@ -185,27 +128,6 @@ return result builtins.sorted = sorted -# -try: - zip -except NameError: - # Pre-2.2 Python has no zip() function. - def zip(*lists): - """ - Emulates the behavior we need from the built-in zip() function - added in Python 2.2. - - Returns a list of tuples, where each tuple contains the i-th - element rom each of the argument sequences. The returned - list is truncated in length to the length of the shortest - argument sequence. - """ - result = [] - for i in range(min(list(map(len, lists)))): - result.append(tuple([l[i] for l in lists])) - return result - builtins.zip = zip - #if sys.version_info[:3] in ((2, 2, 0), (2, 2, 1)): # def lstrip(s, c=string.whitespace): # while s and s[0] in c: Index: runtest.py =================================================================== --- runtest.py (revision 4792) +++ runtest.py (working copy) @@ -97,17 +97,6 @@ import time try: - x = True -except NameError: - True = not 0 - False = not 1 -else: - del x - -if not hasattr(os, 'WEXITSTATUS'): - os.WEXITSTATUS = lambda x: x - -try: sorted except NameError: # Pre-2.4 Python has no sorted() function. Index: QMTest/TestSCons.py =================================================================== --- QMTest/TestSCons.py (revision 4792) +++ QMTest/TestSCons.py (working copy) @@ -23,12 +23,6 @@ import sys import time -try: - True -except NameError: - exec('True = not 0') - exec('False = not 1') - from TestCommon import * from TestCommon import __all__
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-172-23/+16
| | | | | Fix the 'assignment to True or False' and the '__getitem__ not supported for exception classes' deprecation warnings.
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-152-14/+37
| | | | | | | | | Fixes due to running the regression tests with the '-3' option to Python2.6, which causes the run-time to look for potential compatibility problems with Python 3.x. In some cases, all we can do is quiet the warning since we still support Python versions that can't use the newer idiom. In other cases, we fix the problem. This patch contains a mix of quieting and fixing, plus a little lint.
* Refactor use of basestring to use exec() on attempted assignment ofSteven Knight2010-04-151-6/+5
| | | | | basestring to an internal variable (which we thenuse in a common is_basestring() utility function), to avoid triggering the basestring fixer.
* http://scons.tigris.org/issues/show_bug.cgi?id=2345Greg Noel2010-04-155-18/+18
| | | | | | Apply the first part of the 'raise' fixer (the three-argument cases are not converted and will need to wait until native support of with_traceback() is available).
* Add a stub compat/_scon_dbm.py module and copy whichdb.whichdb() toSteven Knight2010-04-142-2/+60
| | | | dbm.whichdb() if necessary.
* Avoid 3.0 fixer issues by not using module names as variable names.Steven Knight2010-04-134-25/+51
|
* Issue 2336: Forward compatibility for use of the "builtins" moduleSteven Knight2010-04-123-45/+52
| | | | instead of __builtin__.