summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/__init__.py4
-rw-r--r--Lib/distutils/command/bdist_rpm.py7
-rw-r--r--Lib/distutils/command/upload.py2
-rw-r--r--Lib/distutils/msvccompiler.py8
-rw-r--r--Lib/distutils/sysconfig.py2
-rw-r--r--Lib/distutils/unixccompiler.py2
6 files changed, 15 insertions, 10 deletions
diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py
index a1dbb4b..9c60e54 100644
--- a/Lib/distutils/__init__.py
+++ b/Lib/distutils/__init__.py
@@ -12,4 +12,6 @@ used from a setup script as
__revision__ = "$Id$"
-__version__ = "2.4.0"
+import sys
+__version__ = "%d.%d.%d" % sys.version_info[:3]
+del sys
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
index 738e3f7..5b09965 100644
--- a/Lib/distutils/command/bdist_rpm.py
+++ b/Lib/distutils/command/bdist_rpm.py
@@ -467,7 +467,8 @@ class bdist_rpm (Command):
# rpm scripts
# figure out default build script
- def_build = "%s setup.py build" % self.python
+ def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0]))
+ def_build = "%s build" % def_setup_call
if self.use_rpm_opt_flags:
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build
@@ -481,9 +482,9 @@ class bdist_rpm (Command):
('prep', 'prep_script', "%setup"),
('build', 'build_script', def_build),
('install', 'install_script',
- ("%s setup.py install "
+ ("%s install "
"--root=$RPM_BUILD_ROOT "
- "--record=INSTALLED_FILES") % self.python),
+ "--record=INSTALLED_FILES") % def_setup_call),
('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
('verifyscript', 'verify_script', None),
('pre', 'pre_install', None),
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index 4a9ed39..67ba080 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -185,7 +185,7 @@ class upload(Command):
http.endheaders()
http.send(body)
except socket.error, e:
- self.announce(e.msg, log.ERROR)
+ self.announce(str(e), log.ERROR)
return
r = http.getresponse()
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py
index d24d0ac..0d72837 100644
--- a/Lib/distutils/msvccompiler.py
+++ b/Lib/distutils/msvccompiler.py
@@ -131,8 +131,10 @@ class MacroExpander:
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
except KeyError, exc: #
raise DistutilsPlatformError, \
- ("The .NET Framework SDK needs to be installed before "
- "building extensions for Python.")
+ ("""Python was built with Visual Studio 2003;
+extensions must be built with a compiler than can generate compatible binaries.
+Visual Studio 2003 was not found on this system. If you have Cygwin installed,
+you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
p = r"Software\Microsoft\NET Framework Setup\Product"
for base in HKEYS:
@@ -237,7 +239,7 @@ class MSVCCompiler (CCompiler) :
def initialize(self):
self.__paths = []
- if os.environ.has_key("MSSdk") and self.find_exe("cl.exe"):
+ if os.environ.has_key("DISTUTILS_USE_SDK") and os.environ.has_key("MSSdk") and self.find_exe("cl.exe"):
# Assume that the SDK set up everything alright; don't try to be
# smarter
self.cc = "cl.exe"
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index e1397a1..76fe256 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -512,7 +512,7 @@ def get_config_vars(*args):
for key in ('LDFLAGS', 'BASECFLAGS'):
flags = _config_vars[key]
flags = re.sub('-arch\s+\w+\s', ' ', flags)
- flags = re.sub('-isysroot [^ \t]* ', ' ', flags)
+ flags = re.sub('-isysroot [^ \t]*', ' ', flags)
_config_vars[key] = flags
if args:
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 324819d..6cd14f7 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -78,7 +78,7 @@ def _darwin_compiler_fixup(compiler_so, cc_args):
try:
index = compiler_so.index('-isysroot')
# Strip this argument and the next one:
- del compiler_so[index:index+1]
+ del compiler_so[index:index+2]
except ValueError:
pass