File tree 1 file changed +12
-7
lines changed
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:
278
278
279
279
from setuptools .command import build_ext
280
280
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
+
281
293
with open ("embed_pil.c" , "w" , encoding = "utf-8" ) as fh :
282
294
home = sys .prefix .replace ("\\ " , "\\ \\ " )
283
295
fh .write (
@@ -305,13 +317,6 @@ def test_embeddable(self) -> None:
305
317
"""
306
318
)
307
319
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 )
315
320
objects = compiler .compile (["embed_pil.c" ])
316
321
compiler .link_executable (objects , "embed_pil" )
317
322
You can’t perform that action at this time.
0 commit comments