[Numpy-svn] r3569 - trunk/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Sun Mar 4 04:47:13 CST 2007


Author: timl
Date: 2007-03-04 04:47:08 -0600 (Sun, 04 Mar 2007)
New Revision: 3569

Modified:
   trunk/numpy/distutils/misc_util.py
Log:
add a delete flag to make_svn_version_py to allow the __svn_version.py to not be deleted

Modified: trunk/numpy/distutils/misc_util.py
===================================================================
--- trunk/numpy/distutils/misc_util.py	2007-03-02 16:49:00 UTC (rev 3568)
+++ trunk/numpy/distutils/misc_util.py	2007-03-04 10:47:08 UTC (rev 3569)
@@ -1304,7 +1304,7 @@
 
         return version
 
-    def make_svn_version_py(self):
+    def make_svn_version_py(self, delete=True):
         """ Generate package __svn_version__.py file from SVN revision number,
         it will be removed after python exits but will be available
         when sdist, etc commands are executed.
@@ -1326,10 +1326,12 @@
 
             import atexit
             def rm_file(f=target,p=self.info):
-                try: os.remove(f); p('removed '+f)
-                except OSError: pass
-                try: os.remove(f+'c'); p('removed '+f+'c')
-                except OSError: pass
+                if delete:
+                    try: os.remove(f); p('removed '+f)
+                    except OSError: pass
+                    try: os.remove(f+'c'); p('removed '+f+'c')
+                    except OSError: pass
+
             atexit.register(rm_file)
 
             return target



More information about the Numpy-svn mailing list