[Numpy-svn] r5588 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Thu Jul 31 18:12:55 CDT 2008


Author: stefan
Date: 2008-07-31 18:12:36 -0500 (Thu, 31 Jul 2008)
New Revision: 5588

Modified:
   trunk/numpy/lib/_datasource.py
Log:
Defer tempfile import to improve startup time.


Modified: trunk/numpy/lib/_datasource.py
===================================================================
--- trunk/numpy/lib/_datasource.py	2008-07-31 20:55:06 UTC (rev 5587)
+++ trunk/numpy/lib/_datasource.py	2008-07-31 23:12:36 UTC (rev 5588)
@@ -35,7 +35,6 @@
 __docformat__ = "restructuredtext en"
 
 import os
-import tempfile
 from shutil import rmtree
 from urlparse import urlparse
 
@@ -131,6 +130,7 @@
             self._destpath = os.path.abspath(destpath)
             self._istmpdest = False
         else:
+            import tempfile # deferring import to improve startup time
             self._destpath = tempfile.mkdtemp()
             self._istmpdest = True
 



More information about the Numpy-svn mailing list