Mailing List Archive

python/dist/src/Lib ConfigParser.py,1.38.10.4,1.38.10.5
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv13419

Modified Files:
Tag: release22-maint
ConfigParser.py
Log Message:
Python 2.2 doesn't have basestring.


Index: ConfigParser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.38.10.4
retrieving revision 1.38.10.5
diff -C2 -d -r1.38.10.4 -r1.38.10.5
*** ConfigParser.py 27 Sep 2002 16:34:30 -0000 1.38.10.4
--- ConfigParser.py 3 Oct 2002 14:56:08 -0000 1.38.10.5
***************
*** 223,227 ****
filename may also be given.
"""
! if isinstance(filenames, basestring):
filenames = [filenames]
for filename in filenames:
--- 223,227 ----
filename may also be given.
"""
! if isinstance(filenames, (str, unicode)):
filenames = [filenames]
for filename in filenames:
Re: python/dist/src/Lib ConfigParser.py,1.38.10.4,1.38.10.5 [ In reply to ]
> Index: ConfigParser.py
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
> retrieving revision 1.38.10.4
> retrieving revision 1.38.10.5
> diff -C2 -d -r1.38.10.4 -r1.38.10.5
> *** ConfigParser.py 27 Sep 2002 16:34:30 -0000 1.38.10.4
> --- ConfigParser.py 3 Oct 2002 14:56:08 -0000 1.38.10.5
> ***************
> *** 223,227 ****
> filename may also be given.
> """
> ! if isinstance(filenames, basestring):
> filenames = [filenames]
> for filename in filenames:
> --- 223,227 ----
> filename may also be given.
> """
> ! if isinstance(filenames, (str, unicode)):
> filenames = [filenames]
> for filename in filenames:

The correct idiom for this is to use types.StringTypes.

--Guido van Rossum (home page: http://www.python.org/~guido/)