summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-10-16 18:11:31 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-10-16 18:11:31 +0000
commitfcc5b25a3526995708ae1c984818c46db161757c (patch)
treed644456e1004958ab748a129b6b9c820ade1d90c /numpy/core
parent15155cf5d7a0f9afc1a9cebb9203d80fddcb6c92 (diff)
downloadnumpy-fcc5b25a3526995708ae1c984818c46db161757c.tar.gz
Applied patch for ticket #345: fix to test_errstate for Python 2.5
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/tests/test_errstate.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/numpy/core/tests/test_errstate.py b/numpy/core/tests/test_errstate.py
index db1c0f18b..669d098d4 100644
--- a/numpy/core/tests/test_errstate.py
+++ b/numpy/core/tests/test_errstate.py
@@ -1,6 +1,13 @@
-#~ import sys
-#~ if sys.version_info[:2] >= (2, 5):
- #~ exec """
+
+# The following exec statement (or something like it) is needed to
+# prevent SyntaxError on Python < 2.5. Even though this is a test,
+# SyntaxErrors are not acceptable; on Debian systems, they block
+# byte-compilation during install and thus cause the package to fail
+# to install.
+
+import sys
+if sys.version_info[:2] >= (2, 5):
+ exec """
from __future__ import with_statement
from numpy.core import *
from numpy.random import rand, randint
@@ -38,8 +45,8 @@ class test_errstate(NumpyTestCase):
pass
else:
self.fail()
-#~ """
+"""
if __name__ == '__main__':
from numpy.testing import *
- NumpyTest().run() \ No newline at end of file
+ NumpyTest().run()