deal with 2/3 naming for stringy things

This commit is contained in:
Martin A. Brown 2016-03-27 01:02:44 -07:00
parent b68a1c3ae4
commit c0233a73b2
1 changed files with 6 additions and 1 deletions

View File

@ -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):