[Python-checkins] python/dist/src/Lib urllib2.py,1.27,1.28
mwh@sourceforge.net
mwh@sourceforge.net
2002年5月20日 07:30:09 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv3320
Modified Files:
urllib2.py
Log Message:
Use types.StringTypes instead of (types.StringType, types.UnicodeType) --
works better (at all!) in --disable-unicode builds.
Bugfix candidate, probably.
Index: urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** urllib2.py 7 Apr 2002 06:36:23 -0000 1.27
--- urllib2.py 20 May 2002 14:30:06 -0000 1.28
***************
*** 304,308 ****
def open(self, fullurl, data=None):
# accept a URL or a Request object
! if isinstance(fullurl, (types.StringType, types.UnicodeType)):
req = Request(fullurl, data)
else:
--- 304,308 ----
def open(self, fullurl, data=None):
# accept a URL or a Request object
! if isinstance(fullurl, types.StringTypes):
req = Request(fullurl, data)
else:
***************
*** 517,521 ****
def add_password(self, realm, uri, user, passwd):
# uri could be a single URI or a sequence
! if isinstance(uri, (types.StringType, types.UnicodeType)):
uri = [uri]
uri = tuple(map(self.reduce_uri, uri))
--- 517,521 ----
def add_password(self, realm, uri, user, passwd):
# uri could be a single URI or a sequence
! if isinstance(uri, types.StringTypes):
uri = [uri]
uri = tuple(map(self.reduce_uri, uri))