Issue #14443: Tell rpmbuild to use the correct version of Python
authorNick Coghlan <ncoghlan@gmail.com>
Mon, 28 May 2012 12:34:46 +0000 (22:34 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Mon, 28 May 2012 12:34:46 +0000 (22:34 +1000)
Lib/distutils/command/bdist_rpm.py
Misc/NEWS

index 357eaa575e6cacf9486a1127633fea6cbe200180..401bc4187270dc99254d6093ebb86ca4123b3819 100644 (file)
@@ -190,7 +190,7 @@ class bdist_rpm(Command):
             if self.fix_python:
                 self.python = sys.executable
             else:
-                self.python = "python"
+                self.python = "python3"
         elif self.fix_python:
             raise DistutilsOptionError(
                   "--python and --fix-python are mutually exclusive options")
@@ -320,6 +320,7 @@ class bdist_rpm(Command):
             rpm_cmd.append('-bb')
         else:
             rpm_cmd.append('-ba')
+        rpm_cmd.extend(['--define', '__python %s' % self.python])
         if self.rpm3_mode:
             rpm_cmd.extend(['--define',
                              '_topdir %s' % os.path.abspath(self.rpm_base)])
index 2b457232f2e4825223188e607d5e02bf08cdfef3..386d103ad65b8a347a1cef8cb75ea69272efd538 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #14443: Tell rpmbuild to use the correct version of Python in
+  bdist_rpm. Initial patch by Ross Lagerwall.
+
 - Issue14929: Stop Idle 3.x from closing on Unicode decode errors when grepping.
   Patch by Roger Serwy.