Skip to content

Commit f65fe9d

Browse files
committed
Restore default behavior on non-Debian systems.
1 parent f945849 commit f65fe9d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

distutils/command/install.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from distutils.util import convert_path, subst_vars, change_root
1515
from distutils.util import get_platform
1616
from distutils.errors import DistutilsOptionError
17+
from distutils._platform import is_debian
1718

1819
from site import USER_BASE
1920
from site import USER_SITE
@@ -206,7 +207,7 @@ def initialize_options(self):
206207

207208
# enable custom installation, known values: deb
208209
self.install_layout = None
209-
210+
210211
self.compile = None
211212
self.optimize = None
212213

@@ -479,11 +480,13 @@ def finalize_unix(self):
479480
or 'VIRTUAL_ENV' in os.environ
480481
or 'real_prefix' in sys.__dict__):
481482
self.select_scheme("unix_prefix")
482-
else:
483+
elif is_debian():
483484
if os.path.normpath(self.prefix) == '/usr/local':
484485
self.prefix = self.exec_prefix = '/usr'
485486
self.install_base = self.install_platbase = '/usr'
486487
self.select_scheme("unix_local")
488+
else:
489+
self.select_scheme("unix_prefix")
487490

488491
def finalize_other(self):
489492
"""Finalizes options for non-posix platforms"""

distutils/command/install_egg_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from distutils.cmd import Command
88
from distutils import log, dir_util
9+
from distutils._platform import is_debian
910
import os, sys, re
1011

1112
class install_egg_info(Command):
@@ -34,7 +35,7 @@ def finalize_options(self):
3435
elif self.prefix_option:
3536
no_pyver = False
3637
else:
37-
no_pyver = True
38+
no_pyver = is_debian()
3839
if no_pyver:
3940
basename = "%s-%s.egg-info" % (
4041
to_filename(safe_name(self.distribution.get_name())),

0 commit comments

Comments
 (0)