[Numpy-svn] r5573 - trunk/numpy/testing

numpy-svn@scip... numpy-svn@scip...
Wed Jul 30 15:27:25 CDT 2008


Author: alan.mcintyre
Date: 2008-07-30 15:27:23 -0500 (Wed, 30 Jul 2008)
New Revision: 5573

Modified:
   trunk/numpy/testing/utils.py
Log:
Delay import of difflib to reduce startup time.


Modified: trunk/numpy/testing/utils.py
===================================================================
--- trunk/numpy/testing/utils.py	2008-07-30 20:22:24 UTC (rev 5572)
+++ trunk/numpy/testing/utils.py	2008-07-30 20:27:23 UTC (rev 5573)
@@ -5,7 +5,6 @@
 import os
 import sys
 import re
-import difflib
 import operator
 from inspect import isfunction
 from nosetester import import_nose
@@ -282,6 +281,9 @@
     exec astr in dict
 
 def assert_string_equal(actual, desired):
+    # delay import of difflib to reduce startup time
+    import difflib
+
     assert isinstance(actual, str),`type(actual)`
     assert isinstance(desired, str),`type(desired)`
     if re.match(r'\A'+desired+r'\Z', actual, re.M): return



More information about the Numpy-svn mailing list