aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/sdist.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-05-03 23:55:42 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-05-03 23:55:42 -0400
commit59cf01356e2611dd921d4cece2176fc9ea7cce59 (patch)
treec12ed528dcd4bfed5e9296d167d7cccdbdc94fa3 /setuptools/command/sdist.py
parenteafde2c8f2870bbe61084c73783b71a3329cafa0 (diff)
downloadexternal_python_setuptools-59cf01356e2611dd921d4cece2176fc9ea7cce59.tar.gz
external_python_setuptools-59cf01356e2611dd921d4cece2176fc9ea7cce59.tar.bz2
external_python_setuptools-59cf01356e2611dd921d4cece2176fc9ea7cce59.zip
Move where add_defaults is defined to align with setuptools
--HG-- branch : Setuptools-Distribute merge extra : source : 6728b2be550b4ed4015d5cdc88bc49141bc40878
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-xsetuptools/command/sdist.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index 2fa3771a..b8c8495e 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -157,7 +157,7 @@ class sdist(_sdist):
import distutils.command
if 'check' not in distutils.command.__all__:
self.check_metadata()
-
+
self.make_distribution()
dist_files = getattr(self.distribution,'dist_files',[])
@@ -166,6 +166,26 @@ class sdist(_sdist):
if data not in dist_files:
dist_files.append(data)
+ def __read_template_hack(self):
+ # This grody hack closes the template file (MANIFEST.in) if an
+ # exception occurs during read_template.
+ # Doing so prevents an error when easy_install attempts to delete the
+ # file.
+ try:
+ _sdist.read_template(self)
+ except:
+ sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
+ raise
+ # Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle
+ # has been fixed, so only override the method if we're using an earlier
+ # Python.
+ if (
+ sys.version_info < (2,7,2)
+ or (3,0) <= sys.version_info < (3,1,4)
+ or (3,2) <= sys.version_info < (3,2,1)
+ ):
+ read_template = __read_template_hack
+
def add_defaults(self):
standards = [READMES,
self.distribution.script_name]
@@ -219,26 +239,6 @@ class sdist(_sdist):
build_scripts = self.get_finalized_command('build_scripts')
self.filelist.extend(build_scripts.get_source_files())
- def __read_template_hack(self):
- # This grody hack closes the template file (MANIFEST.in) if an
- # exception occurs during read_template.
- # Doing so prevents an error when easy_install attempts to delete the
- # file.
- try:
- _sdist.read_template(self)
- except:
- sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
- raise
- # Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle
- # has been fixed, so only override the method if we're using an earlier
- # Python.
- if (
- sys.version_info < (2,7,2)
- or (3,0) <= sys.version_info < (3,1,4)
- or (3,2) <= sys.version_info < (3,2,1)
- ):
- read_template = __read_template_hack
-
def check_readme(self):
for f in READMES:
if os.path.exists(f):