From: Michael W. Hudson Date: Mon, 20 May 2002 14:30:06 +0000 (+0000) Subject: Use types.StringTypes instead of (types.StringType, types.UnicodeType) -- X-Git-Tag: v2.3c1~5641 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3704644acba4bce9aedfa9de169f632fe2a121ac;p=python Use types.StringTypes instead of (types.StringType, types.UnicodeType) -- works better (at all!) in --disable-unicode builds. Bugfix candidate, probably. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index cfb4f64fc8..f5a2f32068 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -303,7 +303,7 @@ class OpenerDirector: def open(self, fullurl, data=None): # accept a URL or a Request object - if isinstance(fullurl, (types.StringType, types.UnicodeType)): + if isinstance(fullurl, types.StringTypes): req = Request(fullurl, data) else: req = fullurl @@ -516,7 +516,7 @@ class HTTPPasswordMgr: def add_password(self, realm, uri, user, passwd): # uri could be a single URI or a sequence - if isinstance(uri, (types.StringType, types.UnicodeType)): + if isinstance(uri, types.StringTypes): uri = [uri] uri = tuple(map(self.reduce_uri, uri)) if not self.passwd.has_key(realm):