Portability of test/EnsureVersion.py back to pre-Python-2 versions.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 30 Aug 2003 16:15:43 +0000 (16:15 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 30 Aug 2003 16:15:43 +0000 (16:15 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@786 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/EnsureVersion.py

index c4005e07da37464cdc86468792500c85545b6873..4c67e836eb48748482efac4b0a8ba9f83bed6f09 100644 (file)
@@ -78,7 +78,10 @@ sys.exit(0)
 
 test.write('SConstruct', """\
 import sys
-delattr(sys, 'version_info')
+try:
+    delattr(sys, 'version_info')
+except AttributeError:
+    pass
 sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
 EnsurePythonVersion(1,3)
 sys.exit(0)
@@ -88,7 +91,10 @@ test.run()
 
 test.write('SConstruct', """\
 import sys
-delattr(sys, 'version_info')
+try:
+    delattr(sys, 'version_info')
+except AttributeError:
+    pass
 sys.version = '2.3+ (#0, Feb 24 2003, 19:13:11)\\n'
 EnsurePythonVersion(2,2)
 sys.exit(0)
@@ -98,7 +104,10 @@ test.run()
 
 test.write('SConstruct', """\
 import sys
-delattr(sys, 'version_info')
+try:
+    delattr(sys, 'version_info')
+except AttributeError:
+    pass
 sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
 EnsurePythonVersion(2,3)
 sys.exit(0)
@@ -108,7 +117,10 @@ test.run()
 
 test.write('SConstruct', """\
 import sys
-delattr(sys, 'version_info')
+try:
+    delattr(sys, 'version_info')
+except AttributeError:
+    pass
 sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
 EnsurePythonVersion(2,4)
 sys.exit(0)