move import used only on Windows and remove unused import

This commit is contained in:
nulano 2022-10-30 03:17:13 +00:00
parent eaee7fda97
commit 181fad2918
No known key found for this signature in database
GPG Key ID: B650CDF63B705766

View File

@ -4,11 +4,10 @@ import sys
import sysconfig
import pytest
from setuptools.command.build_ext import new_compiler
from PIL import Image
from .helper import assert_image_equal, hopper, is_win32, on_ci
from .helper import assert_image_equal, hopper, is_win32
# CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2
# https://github.com/eliben/pycparser/pull/198#issuecomment-317001670
@ -410,6 +409,7 @@ class TestEmbeddable:
@pytest.mark.skipif(not is_win32(), reason="requires Windows")
def test_embeddable(self):
import ctypes
from setuptools.command.build_ext import new_compiler
with open("embed_pil.c", "w", encoding="utf-8") as fh:
fh.write(