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

Skip to content

Commit c72dd38

Browse files
committed
Patch #1075887: Don't require MSVC in distutils if there is nothing
to build. Will backport to 2.4
1 parent 637431b commit c72dd38

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/distutils/msvccompiler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ def __init__ (self, verbose=0, dry_run=0, force=0):
211211
self.__macros = MacroExpander(self.__version)
212212
else:
213213
self.__root = r"Software\Microsoft\Devstudio"
214+
self.initialized = False
215+
216+
def initialize(self):
214217
self.__paths = self.get_msvc_paths("path")
215218

216219
if len (self.__paths) == 0:
@@ -290,6 +293,7 @@ def compile(self, sources,
290293
output_dir=None, macros=None, include_dirs=None, debug=0,
291294
extra_preargs=None, extra_postargs=None, depends=None):
292295

296+
if not self.initialized: self.initialize()
293297
macros, objects, extra_postargs, pp_opts, build = \
294298
self._setup_compile(output_dir, macros, include_dirs, sources,
295299
depends, extra_postargs)
@@ -381,6 +385,7 @@ def create_static_lib (self,
381385
debug=0,
382386
target_lang=None):
383387

388+
if not self.initialized: self.initialize()
384389
(objects, output_dir) = self._fix_object_args (objects, output_dir)
385390
output_filename = \
386391
self.library_filename (output_libname, output_dir=output_dir)
@@ -414,6 +419,7 @@ def link (self,
414419
build_temp=None,
415420
target_lang=None):
416421

422+
if not self.initialized: self.initialize()
417423
(objects, output_dir) = self._fix_object_args (objects, output_dir)
418424
(libraries, library_dirs, runtime_library_dirs) = \
419425
self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Extension Modules
7272
Library
7373
-------
7474

75+
- Patch #1075887: Don't require MSVC in distutils if there is nothing
76+
to build.
77+
7578
- Patch #1103407: Properly deal with tarfile iterators when untarring
7679
symbolic links on Windows.
7780

0 commit comments

Comments
 (0)