File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,18 @@ def test_embeddable(self) -> None:
278278
279279 from setuptools .command import build_ext
280280
281+ compiler = getattr (build_ext , "new_compiler" )()
282+ compiler .add_include_dir (sysconfig .get_config_var ("INCLUDEPY" ))
283+
284+ libdir = sysconfig .get_config_var ("LIBDIR" ) or sysconfig .get_config_var (
285+ "INCLUDEPY"
286+ ).replace ("include" , "libs" )
287+ compiler .add_library_dir (libdir )
288+ try :
289+ compiler .initialize ()
290+ except Exception :
291+ pytest .skip ("Compiler could not be initialized" )
292+
281293 with open ("embed_pil.c" , "w" , encoding = "utf-8" ) as fh :
282294 home = sys .prefix .replace ("\\ " , "\\ \\ " )
283295 fh .write (
@@ -305,13 +317,6 @@ def test_embeddable(self) -> None:
305317 """
306318 )
307319
308- compiler = getattr (build_ext , "new_compiler" )()
309- compiler .add_include_dir (sysconfig .get_config_var ("INCLUDEPY" ))
310-
311- libdir = sysconfig .get_config_var ("LIBDIR" ) or sysconfig .get_config_var (
312- "INCLUDEPY"
313- ).replace ("include" , "libs" )
314- compiler .add_library_dir (libdir )
315320 objects = compiler .compile (["embed_pil.c" ])
316321 compiler .link_executable (objects , "embed_pil" )
317322
You can’t perform that action at this time.
0 commit comments