mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Look in a different location for the tk intepreter on pypy fixes #2376
This commit is contained in:
parent
e66271d464
commit
a69c37738a
|
@ -32,6 +32,13 @@ except ImportError:
|
|||
tkinter = Tkinter
|
||||
del Tkinter
|
||||
|
||||
# required for pypy, which always has cffi installed
|
||||
try:
|
||||
from cffi import FFI
|
||||
ffi = FFI()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from . import Image
|
||||
from io import BytesIO
|
||||
|
||||
|
@ -184,6 +191,12 @@ class PhotoImage(object):
|
|||
try:
|
||||
from . import _imagingtk
|
||||
try:
|
||||
if hasattr(tk, 'interp'):
|
||||
# Pypy is using a ffi cdata element
|
||||
# (Pdb) self.tk.interp
|
||||
# <cdata 'Tcl_Interp *' 0x3061b50>
|
||||
_imagingtk.tkinit(int(ffi.cast("uintptr_t", tk.interp)), 1)
|
||||
else:
|
||||
_imagingtk.tkinit(tk.interpaddr(), 1)
|
||||
except AttributeError:
|
||||
_imagingtk.tkinit(id(tk), 0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user