]> granicus.if.org Git - python/commitdiff
Use types.StringTypes instead of (types.StringType, types.UnicodeType) --
authorMichael W. Hudson <mwh@python.net>
Mon, 20 May 2002 14:30:06 +0000 (14:30 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 20 May 2002 14:30:06 +0000 (14:30 +0000)
works better (at all!) in --disable-unicode builds.

Bugfix candidate, probably.

Lib/urllib2.py

index cfb4f64fc8c172a1825ab4d6ce5075895aec4856..f5a2f320681b22563ee0b2a50d347d3413cef5a7 100644 (file)
@@ -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):