mirror of https://github.com/tLDP/python-tldp
deal with 2/3 naming for stringy things
This commit is contained in:
parent
b68a1c3ae4
commit
c0233a73b2
|
@ -225,7 +225,12 @@ def isreadablefile(f):
|
|||
|
||||
def isstr(s):
|
||||
'''True if argument is stringy (unicode or string)'''
|
||||
return isinstance(s, basestring)
|
||||
try:
|
||||
unicode
|
||||
stringy = (str, unicode)
|
||||
except NameError:
|
||||
stringy = (str,)
|
||||
return isinstance(s, stringy)
|
||||
|
||||
|
||||
def which(program):
|
||||
|
|
Loading…
Reference in New Issue