From c0233a73b204c01492dff963100e06eec72bfa91 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Sun, 27 Mar 2016 01:02:44 -0700 Subject: [PATCH] deal with 2/3 naming for stringy things --- tldp/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tldp/utils.py b/tldp/utils.py index 35def09..1685242 100644 --- a/tldp/utils.py +++ b/tldp/utils.py @@ -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):