Skip to content

Commit

Permalink
Only import ctypes as needed on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 19, 2022
1 parent ca3bc29 commit 2a285d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Tests/test_image_access.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ctypes
import os
import subprocess
import sys
Expand Down Expand Up @@ -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(
"""
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_imagewin_pointers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ctypes
from io import BytesIO

from PIL import Image, ImageWin
Expand All @@ -8,6 +7,7 @@
# see https://github.com/python-pillow/Pillow/pull/1431#issuecomment-144692652

if is_win32():
import ctypes
import ctypes.wintypes

class BITMAPFILEHEADER(ctypes.Structure):
Expand Down

0 comments on commit 2a285d1

Please sign in to comment.