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