mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Only import ctypes as needed on Windows
This commit is contained in:
parent
ca3bc290e3
commit
2a285d1b1f
|
@ -1,4 +1,3 @@
|
|||
import ctypes
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -404,6 +403,8 @@ class TestEmbeddable:
|
|||
"not from shell",
|
||||
)
|
||||
def test_embeddable(self):
|
||||
import ctypes
|
||||
|
||||
with open("embed_pil.c", "w") as fh:
|
||||
fh.write(
|
||||
"""
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import ctypes
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, ImageWin
|
||||
|
@ -8,6 +7,7 @@ from .helper import hopper, is_win32
|
|||
# see https://github.com/python-pillow/Pillow/pull/1431#issuecomment-144692652
|
||||
|
||||
if is_win32():
|
||||
import ctypes
|
||||
import ctypes.wintypes
|
||||
|
||||
class BITMAPFILEHEADER(ctypes.Structure):
|
||||
|
|
Loading…
Reference in New Issue
Block a user