[Python-checkins] python/dist/src/Lib/email Charset.py,1.14,1.15
bwarsaw at users.sourceforge.net
bwarsaw at users.sourceforge.net
Sat May 8 23:24:45 EDT 2004
Update of /cvsroot/python/python/dist/src/Lib/email
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10504
Modified Files:
Charset.py
Log Message:
Update to Python 2.3, getting rid of backward compatiblity crud.
Index: Charset.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Charset.py 30 Dec 2003 16:52:25 -0000 1.14
--- Charset.py 9 May 2004 03:24:43 -0000 1.15
***************
*** 1,4 ****
! # Copyright (C) 2001,2002 Python Software Foundation
! # Author: che at debian.org (Ben Gertzfield), barry at zope.com (Barry Warsaw)
# Python 2.3 doesn't come with any Asian codecs by default. Two packages are
--- 1,6 ----
! # Copyright (C) 2001-2004 Python Software Foundation
! # Author: che at debian.org (Ben Gertzfield), barry at python.org (Barry Warsaw)
!
! # XXX The following information needs updating.
# Python 2.3 doesn't come with any Asian codecs by default. Two packages are
***************
*** 13,30 ****
# Some Japanese users prefer this codec package
- from types import UnicodeType
- from email.Encoders import encode_7or8bit
import email.base64MIME
import email.quopriMIME
!
! def _isunicode(s):
! return isinstance(s, UnicodeType)
!
! # Python 2.2.1 and beyond has these symbols
! try:
! True, False
! except NameError:
! True = 1
! False = 0
--- 15,21 ----
# Some Japanese users prefer this codec package
import email.base64MIME
import email.quopriMIME
! from email.Encoders import encode_7or8bit
***************
*** 281,285 ****
with the Unicode replacement character U+FFFD.
"""
! if _isunicode(s) or self.input_codec is None:
return s
try:
--- 272,276 ----
with the Unicode replacement character U+FFFD.
"""
! if isinstance(s, unicode) or self.input_codec is None:
return s
try:
***************
*** 307,311 ****
else:
codec = self.input_codec
! if not _isunicode(ustr) or codec is None:
return ustr
try:
--- 298,302 ----
else:
codec = self.input_codec
! if not isinstance(ustr, unicode) or codec is None:
return ustr
try:
More information about the Python-checkins
mailing list