mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Only import cffi where needed, to avoid problems with PYTHONOPTIMIZE=2
This commit is contained in:
		
							parent
							
								
									663b06e223
								
							
						
					
					
						commit
						29b2c6e23d
					
				| 
						 | 
				
			
			@ -32,13 +32,6 @@ if sys.version_info.major > 2:
 | 
			
		|||
else:
 | 
			
		||||
    import Tkinter as 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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -192,7 +185,11 @@ class PhotoImage(object):
 | 
			
		|||
                from . import _imagingtk
 | 
			
		||||
                try:
 | 
			
		||||
                    if hasattr(tk, 'interp'):
 | 
			
		||||
                        # Pypy is using a ffi cdata element
 | 
			
		||||
                        # Required for PyPy, which always has CFFI installed
 | 
			
		||||
                        from cffi import FFI
 | 
			
		||||
                        ffi = FFI()
 | 
			
		||||
 | 
			
		||||
                        # Pypy is using an FFI cdata element
 | 
			
		||||
                        # (Pdb) self.tk.interp
 | 
			
		||||
                        #  <cdata 'Tcl_Interp *' 0x3061b50>
 | 
			
		||||
                        _imagingtk.tkinit(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user