update to python3.7
This commit is contained in:
parent
da2d24a7f4
commit
80c4a755da
2912 changed files with 206832 additions and 100407 deletions
30
lib/python3.7/site-packages/PIL/_util.py
Normal file
30
lib/python3.7/site-packages/PIL/_util.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
py3 = sys.version_info.major >= 3
|
||||
|
||||
if py3:
|
||||
def isStringType(t):
|
||||
return isinstance(t, str)
|
||||
|
||||
def isPath(f):
|
||||
return isinstance(f, (bytes, str))
|
||||
else:
|
||||
def isStringType(t):
|
||||
return isinstance(t, basestring)
|
||||
|
||||
def isPath(f):
|
||||
return isinstance(f, basestring)
|
||||
|
||||
|
||||
# Checks if an object is a string, and that it points to a directory.
|
||||
def isDirectory(f):
|
||||
return isPath(f) and os.path.isdir(f)
|
||||
|
||||
|
||||
class deferred_error(object):
|
||||
def __init__(self, ex):
|
||||
self.ex = ex
|
||||
|
||||
def __getattr__(self, elt):
|
||||
raise self.ex
|
||||
Loading…
Add table
Add a link
Reference in a new issue