[Python-checkins] r42548 - sandbox/trunk/setuptools/setuptools/command/egg_info.py sandbox/trunk/setuptools/setuptools/command/sdist.py

phillip.eby python-checkins at python.org
Tue Feb 21 23:44:59 CET 2006


Author: phillip.eby
Date: Tue Feb 21 23:44:58 2006
New Revision: 42548

Modified:
   sandbox/trunk/setuptools/setuptools/command/egg_info.py
   sandbox/trunk/setuptools/setuptools/command/sdist.py
Log:
Prevent failed attempts at removing MANIFEST.in from masking errors that 
occur while reading it.


Modified: sandbox/trunk/setuptools/setuptools/command/egg_info.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/egg_info.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/egg_info.py	Tue Feb 21 23:44:58 2006
@@ -7,7 +7,7 @@
 from setuptools import Command
 from distutils.errors import *
 from distutils import log
-from distutils.command.sdist import sdist
+from setuptools.command.sdist import sdist
 from distutils import file_util
 from distutils.util import convert_path
 from distutils.filelist import FileList
@@ -203,7 +203,6 @@
 
 
 
-
 class manifest_maker(sdist):
 
     template = "MANIFEST.in"

Modified: sandbox/trunk/setuptools/setuptools/command/sdist.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/sdist.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/sdist.py	Tue Feb 21 23:44:58 2006
@@ -1,6 +1,6 @@
 from distutils.command.sdist import sdist as _sdist
 from distutils.util import convert_path
-import os,re
+import os, re, sys
 
 entities = [
     ("&lt;","<"), ("&gt;", ">"), ("&quot;", '"'), ("&apos;", "'"),
@@ -152,13 +152,13 @@
             if data not in dist_files:
                 dist_files.append(data)
 
-
-
-
-
-
-
-
-
-
+    def read_template(self):
+        try:
+            _sdist.read_template(self)
+        except:
+            # grody hack to close the template file (MANIFEST.in)
+            # this prevents easy_install's attempt at deleting the file from
+            # dying and thus masking the real error
+            sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
+            raise
 


More information about the Python-checkins mailing list