[Numpy-svn] r3344 - trunk/numpy/core/tests

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Oct 16 14:11:34 EDT 2006


Author: oliphant
Date: 2006-10-16 13:11:31 -0500 (Mon, 16 Oct 2006)
New Revision: 3344

Modified:
   trunk/numpy/core/tests/test_errstate.py
Log:
Applied patch for ticket #345: fix to test_errstate for Python 2.5

Modified: trunk/numpy/core/tests/test_errstate.py
===================================================================
--- trunk/numpy/core/tests/test_errstate.py	2006-10-16 17:55:30 UTC (rev 3343)
+++ trunk/numpy/core/tests/test_errstate.py	2006-10-16 18:11:31 UTC (rev 3344)
@@ -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 @@
                 pass
             else:
                 self.fail()
-#~ """
+"""
 
 if __name__ == '__main__':
     from numpy.testing import *
-    NumpyTest().run()
\ No newline at end of file
+    NumpyTest().run()




More information about the Numpy-svn mailing list