mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +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 os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -404,6 +403,8 @@ class TestEmbeddable:
|
||||||
"not from shell",
|
"not from shell",
|
||||||
)
|
)
|
||||||
def test_embeddable(self):
|
def test_embeddable(self):
|
||||||
|
import ctypes
|
||||||
|
|
||||||
with open("embed_pil.c", "w") as fh:
|
with open("embed_pil.c", "w") as fh:
|
||||||
fh.write(
|
fh.write(
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import ctypes
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from PIL import Image, ImageWin
|
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
|
# see https://github.com/python-pillow/Pillow/pull/1431#issuecomment-144692652
|
||||||
|
|
||||||
if is_win32():
|
if is_win32():
|
||||||
|
import ctypes
|
||||||
import ctypes.wintypes
|
import ctypes.wintypes
|
||||||
|
|
||||||
class BITMAPFILEHEADER(ctypes.Structure):
|
class BITMAPFILEHEADER(ctypes.Structure):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user