churchyard / rpms / python3

Forked from rpms/python3 3 years ago
Clone

Blame 00252-add-executable-option.patch

ef5c6fe
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
ef5c6fe
index c89d5ef..dd61621 100644
ef5c6fe
--- a/Lib/distutils/cmd.py
ef5c6fe
+++ b/Lib/distutils/cmd.py
ef5c6fe
@@ -296,7 +296,8 @@ class Command:
ef5c6fe
         finalized command object.
ef5c6fe
         """
ef5c6fe
         cmd_obj = self.distribution.get_command_obj(command, create)
ef5c6fe
-        cmd_obj.ensure_finalized()
ef5c6fe
+        if cmd_obj is not None:
ef5c6fe
+            cmd_obj.ensure_finalized()
ef5c6fe
         return cmd_obj
ef5c6fe
ef5c6fe
     # XXX rename to 'get_reinitialized_command()'? (should do the
ef5c6fe
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
ef5c6fe
index 8174192..30ca739 100644
ef5c6fe
--- a/Lib/distutils/command/install.py
ef5c6fe
+++ b/Lib/distutils/command/install.py
ef5c6fe
@@ -122,6 +122,8 @@ class install(Command):
ef5c6fe
          "force installation (overwrite any existing files)"),
ef5c6fe
         ('skip-build', None,
ef5c6fe
          "skip rebuilding everything (for testing/debugging)"),
ef5c6fe
+        ('executable=', 'e',
ef5c6fe
+         "specify final destination interpreter path (install.py)"),
ef5c6fe
ef5c6fe
         # Where to install documentation (eventually!)
ef5c6fe
         #('doc-format=', None, "format of documentation to generate"),
ef5c6fe
@@ -194,6 +196,7 @@ class install(Command):
ef5c6fe
         # directory not in sys.path.
ef5c6fe
         self.force = 0
ef5c6fe
         self.skip_build = 0
ef5c6fe
+        self.executable = None
ef5c6fe
         self.warn_dir = 1
ef5c6fe
ef5c6fe
         # These are only here as a conduit from the 'build' command to the
ef5c6fe
@@ -365,6 +368,9 @@ class install(Command):
ef5c6fe
                                    ('build_base', 'build_base'),
ef5c6fe
                                    ('build_lib', 'build_lib'))
ef5c6fe
ef5c6fe
+        if self.executable is None:
ef5c6fe
+            self.executable = os.path.normpath(sys.executable)
ef5c6fe
+
ef5c6fe
         # Punt on doc directories for now -- after all, we're punting on
ef5c6fe
         # documentation completely!
ef5c6fe