mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Use types.StringTypes instead of (types.StringType, types.UnicodeType) --
works better (at all!) in --disable-unicode builds. Bugfix candidate, probably.
This commit is contained in:
parent
9c373061ad
commit
3704644acb
1 changed files with 2 additions and 2 deletions
|
@ -303,7 +303,7 @@ class OpenerDirector:
|
||||||
|
|
||||||
def open(self, fullurl, data=None):
|
def open(self, fullurl, data=None):
|
||||||
# accept a URL or a Request object
|
# accept a URL or a Request object
|
||||||
if isinstance(fullurl, (types.StringType, types.UnicodeType)):
|
if isinstance(fullurl, types.StringTypes):
|
||||||
req = Request(fullurl, data)
|
req = Request(fullurl, data)
|
||||||
else:
|
else:
|
||||||
req = fullurl
|
req = fullurl
|
||||||
|
@ -516,7 +516,7 @@ class HTTPPasswordMgr:
|
||||||
|
|
||||||
def add_password(self, realm, uri, user, passwd):
|
def add_password(self, realm, uri, user, passwd):
|
||||||
# uri could be a single URI or a sequence
|
# uri could be a single URI or a sequence
|
||||||
if isinstance(uri, (types.StringType, types.UnicodeType)):
|
if isinstance(uri, types.StringTypes):
|
||||||
uri = [uri]
|
uri = [uri]
|
||||||
uri = tuple(map(self.reduce_uri, uri))
|
uri = tuple(map(self.reduce_uri, uri))
|
||||||
if not self.passwd.has_key(realm):
|
if not self.passwd.has_key(realm):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue