Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update references to "distutils" package
  • Loading branch information
vstinner committed May 9, 2022
commit 3c29fb9cba1d50c66eccbf82929e10c547e6cf2f
2 changes: 1 addition & 1 deletion Lib/_distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
raise DistutilsPlatformError(msg)

try:
module_name = "distutils." + module_name
module_name = "_distutils." + module_name
__import__ (module_name)
module = sys.modules[module_name]
klass = vars(module)[class_name]
Expand Down
8 changes: 4 additions & 4 deletions Lib/_distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def find_config_files(self):
check_environ()

# Where to look for the system-wide Distutils config file
sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
sys_dir = os.path.dirname(sys.modules['_distutils'].__file__)

# Look for the system config file
sys_file = os.path.join(sys_dir, "distutils.cfg")
Expand Down Expand Up @@ -799,8 +799,8 @@ def get_command_packages(self):
if pkgs is None:
pkgs = ''
pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != '']
if "distutils.command" not in pkgs:
pkgs.insert(0, "distutils.command")
if "_distutils.command" not in pkgs:
pkgs.insert(0, "_distutils.command")
self.command_packages = pkgs
return pkgs

Expand All @@ -809,7 +809,7 @@ def get_command_class(self, command):
'command'. First we check the 'cmdclass' dictionary; if the
command is mentioned there, we fetch the class object from the
dictionary and return it. Otherwise we load the command module
("distutils.command." + command) and fetch the command class from
("_distutils.command." + command) and fetch the command class from
the module. The loaded class is also stored in 'cmdclass'
to speed future calls to 'get_command_class()'.

Expand Down