summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Script
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/Script
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/Script')
-rw-r--r--src/engine/SCons/Script/Interactive.py2
-rw-r--r--src/engine/SCons/Script/Main.py13
-rw-r--r--src/engine/SCons/Script/SConsOptions.py7
-rw-r--r--src/engine/SCons/Script/SConscript.py2
-rw-r--r--src/engine/SCons/Script/__init__.py5
5 files changed, 7 insertions, 22 deletions
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py
index 63316fd..ffb5096 100644
--- a/src/engine/SCons/Script/Interactive.py
+++ b/src/engine/SCons/Script/Interactive.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/Script/Main.py b/src/engine/SCons/Script/Main.py
index 7b58594..f78c2ec 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -32,8 +32,6 @@ it goes here.
# 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__"
@@ -270,13 +268,10 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
sys.stderr.write(errfmt % (nodename, buildError))
if (buildError.exc_info[2] and buildError.exc_info[1] and
- # TODO(1.5)
- #not isinstance(
- # buildError.exc_info[1],
- # (EnvironmentError, SCons.Errors.StopError, SCons.Errors.UserError))):
- not isinstance(buildError.exc_info[1], EnvironmentError) and
- not isinstance(buildError.exc_info[1], SCons.Errors.StopError) and
- not isinstance(buildError.exc_info[1], SCons.Errors.UserError)):
+ not isinstance(
+ buildError.exc_info[1],
+ (EnvironmentError, SCons.Errors.StopError,
+ SCons.Errors.UserError))):
type, value, trace = buildError.exc_info
traceback.print_exception(type, value, trace)
elif tb and print_stacktrace:
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 7f78a71..db52509 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -28,12 +28,7 @@ import re
import sys
import textwrap
-try:
- no_hyphen_re = re.compile(r'(\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')
-except re.error:
- # Pre-2.0 Python versions don't have the (?<= negative
- # look-behind assertion.
- no_hyphen_re = re.compile(r'(\s+|-*\w{2,}-(?=\w{2,}))')
+no_hyphen_re = re.compile(r'(\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')
try:
from gettext import gettext
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 7640ec8..5928a88 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -26,8 +26,6 @@ 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 generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 465508c..bb7b632 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -64,9 +64,8 @@ if "--debug=memoizer" in _args:
try:
SCons.Memoize.EnableMemoization()
except SCons.Warnings.Warning:
- # Some warning was thrown (inability to --debug=memoizer on
- # Python 1.5.2 because it doesn't have metaclasses). Arrange
- # for it to be displayed or not after warnings are configured.
+ # Some warning was thrown. Arrange for it to be displayed
+ # or not after warnings are configured.
import Main
exc_type, exc_value, tb = sys.exc_info()
Main.delayed_warnings.append((exc_type, exc_value))