@@ -266,29 +266,35 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
266
266
)
267
267
268
268
269
+ def _customize_macos ():
270
+ if sys .platform != "darwin" :
271
+ return
272
+
273
+ # Perform first-time customization of compiler-related
274
+ # config vars on OS X now that we know we need a compiler.
275
+ # This is primarily to support Pythons from binary
276
+ # installers. The kind and paths to build tools on
277
+ # the user system may vary significantly from the system
278
+ # that Python itself was built on. Also the user OS
279
+ # version and build tools may not support the same set
280
+ # of CPU architectures for universal builds.
281
+ global _config_vars
282
+ # Use get_config_var() to ensure _config_vars is initialized.
283
+ if not get_config_var ('CUSTOMIZED_OSX_COMPILER' ):
284
+ import _osx_support
285
+
286
+ _osx_support .customize_compiler (_config_vars )
287
+ _config_vars ['CUSTOMIZED_OSX_COMPILER' ] = 'True'
288
+
289
+
269
290
def customize_compiler (compiler ): # noqa: C901
270
291
"""Do any platform-specific customization of a CCompiler instance.
271
292
272
293
Mainly needed on Unix, so we can plug in the information that
273
294
varies across Unices and is stored in Python's Makefile.
274
295
"""
275
296
if compiler .compiler_type == "unix" :
276
- if sys .platform == "darwin" :
277
- # Perform first-time customization of compiler-related
278
- # config vars on OS X now that we know we need a compiler.
279
- # This is primarily to support Pythons from binary
280
- # installers. The kind and paths to build tools on
281
- # the user system may vary significantly from the system
282
- # that Python itself was built on. Also the user OS
283
- # version and build tools may not support the same set
284
- # of CPU architectures for universal builds.
285
- global _config_vars
286
- # Use get_config_var() to ensure _config_vars is initialized.
287
- if not get_config_var ('CUSTOMIZED_OSX_COMPILER' ):
288
- import _osx_support
289
-
290
- _osx_support .customize_compiler (_config_vars )
291
- _config_vars ['CUSTOMIZED_OSX_COMPILER' ] = 'True'
297
+ _customize_macos ()
292
298
293
299
(
294
300
cc ,
0 commit comments