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

numpy-svn@scip... numpy-svn@scip...
Wed Jul 30 15:50:22 CDT 2008


Author: alan.mcintyre
Date: 2008-07-30 15:50:20 -0500 (Wed, 30 Jul 2008)
New Revision: 5575

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


Modified: trunk/numpy/testing/utils.py
===================================================================
--- trunk/numpy/testing/utils.py	2008-07-30 20:36:33 UTC (rev 5574)
+++ trunk/numpy/testing/utils.py	2008-07-30 20:50:20 UTC (rev 5575)
@@ -6,7 +6,6 @@
 import sys
 import re
 import operator
-from inspect import isfunction
 from nosetester import import_nose
 
 __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal',
@@ -368,6 +367,10 @@
     else:
         testmatch = re.compile(testmatch)
     cls_attr = cls.__dict__
+
+    # delayed import to reduce startup time
+    from inspect import isfunction
+
     methods = filter(isfunction, cls_attr.values())
     for function in methods:
         try:



More information about the Numpy-svn mailing list