summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorphillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771>2007-01-09 19:22:42 +0000
committerphillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771>2007-01-09 19:22:42 +0000
commitba7fa07aa0cefaaa88b1bb8935fad580e62ce99a (patch)
tree6c08ecd929eba46a74da74130affb88467caa74a /setuptools/command
parent2dfc4f66a7ff32f453a66d0086b5a14449ecd6c3 (diff)
downloadpython-setuptools-ba7fa07aa0cefaaa88b1bb8935fad580e62ce99a.tar.gz
Workaround for Python 2.5 distutils bug: when bdist_wininst files are
uploaded, they are marked as suitable for "any" Python version, even if an explicit --target-version was specified. (This needs to be fixed in the distutils too.) git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@53318 6015fed2-1504-0410-9fe1-9d1591cc4771
Diffstat (limited to 'setuptools/command')
-rwxr-xr-xsetuptools/command/bdist_wininst.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/setuptools/command/bdist_wininst.py b/setuptools/command/bdist_wininst.py
index 2dcc48c..0d70ff7 100755
--- a/setuptools/command/bdist_wininst.py
+++ b/setuptools/command/bdist_wininst.py
@@ -2,24 +2,27 @@ from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
import os, sys
class bdist_wininst(_bdist_wininst):
- if sys.version<'2.5':
- def create_exe(self, arcname, fullname, bitmap=None):
-
- _bdist_wininst.create_exe(self, arcname, fullname, bitmap)
-
- if self.target_version:
- installer_name = os.path.join(self.dist_dir,
- "%s.win32-py%s.exe" %
- (fullname, self.target_version))
- pyversion = self.target_version
- else:
- installer_name = os.path.join(self.dist_dir,
- "%s.win32.exe" % fullname)
- pyversion = 'any'
-
- getattr(self.distribution,'dist_files',[]).append(
- ('bdist_wininst', pyversion, installer_name)
- )
+
+ def create_exe(self, arcname, fullname, bitmap=None):
+ _bdist_wininst.create_exe(self, arcname, fullname, bitmap)
+ dist_files = getattr(self.distribution, 'dist_files', [])
+
+ if self.target_version:
+ installer_name = os.path.join(self.dist_dir,
+ "%s.win32-py%s.exe" %
+ (fullname, self.target_version))
+ pyversion = self.target_version
+
+ # fix 2.5 bdist_wininst ignoring --target-version spec
+ bad = ('bdist_wininst','any',installer_name)
+ if bad in dist_files:
+ dist_files.remove(bad)
+ else:
+ installer_name = os.path.join(self.dist_dir,
+ "%s.win32.exe" % fullname)
+ pyversion = 'any'
+
+ dist_files.append(('bdist_wininst', pyversion, installer_name))
def reinitialize_command (self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(