Clean up checking for platform and versions when checking for bdist_wininst and
bdist_msi - initial patch supplied by Amaury Forgeot d'Arc.
This commit is contained in:
parent
abecfc7631
commit
2737ae2f12
33
setup.py
33
setup.py
@ -10,10 +10,15 @@ Unix platforms
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.platform == "win32":
|
import distutils.command
|
||||||
if sys.version_info[:2] >= (2, 5):
|
try:
|
||||||
import distutils.command.bdist_msi
|
import distutils.command.bdist_msi
|
||||||
|
except ImportError:
|
||||||
|
distutils.command.bdist_msi = None
|
||||||
|
try:
|
||||||
import distutils.command.bdist_wininst
|
import distutils.command.bdist_wininst
|
||||||
|
except ImportError:
|
||||||
|
distutils.command.bdist_wininst = None
|
||||||
import distutils.command.bdist_rpm
|
import distutils.command.bdist_rpm
|
||||||
import distutils.command.build
|
import distutils.command.build
|
||||||
import distutils.dist
|
import distutils.dist
|
||||||
@ -231,20 +236,20 @@ class build(distutils.command.build.build):
|
|||||||
commandClasses = dict(build = build, bdist_rpm = bdist_rpm)
|
commandClasses = dict(build = build, bdist_rpm = bdist_rpm)
|
||||||
|
|
||||||
# tweak the Windows installer names to include the Oracle version
|
# tweak the Windows installer names to include the Oracle version
|
||||||
if sys.platform == "win32":
|
if distutils.command.bdist_msi is not None:
|
||||||
|
|
||||||
if sys.version_info[:2] >= (2, 5):
|
|
||||||
|
|
||||||
class bdist_msi(distutils.command.bdist_msi.bdist_msi):
|
class bdist_msi(distutils.command.bdist_msi.bdist_msi):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
origMethod = self.distribution.get_fullname
|
origMethod = self.distribution.get_fullname
|
||||||
self.distribution.get_fullname = \
|
self.distribution.get_fullname = \
|
||||||
self.distribution.get_fullname_with_oracle_version
|
self.distribution.get_fullname_with_oracle_version
|
||||||
distutils.command.bdist_msi.bdist_msi.run(self)
|
distutils.command.bdist_msi.bdist_msi.run(self)
|
||||||
self.distribution.get_fullname = origMethod
|
self.distribution.get_fullname = origMethod
|
||||||
|
|
||||||
commandClasses["bdist_msi"] = bdist_msi
|
commandClasses["bdist_msi"] = bdist_msi
|
||||||
|
|
||||||
|
if distutils.command.bdist_wininst is not None:
|
||||||
|
|
||||||
class bdist_wininst(distutils.command.bdist_wininst.bdist_wininst):
|
class bdist_wininst(distutils.command.bdist_wininst.bdist_wininst):
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user