diff options
author | Barry Warsaw <barry@python.org> | 2004-05-09 03:55:11 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2004-05-09 03:55:11 (GMT) |
commit | 24f79762a10bdadcf8383e5a94acf5346810d4d5 (patch) | |
tree | 2cefd9ed86b17e1bd4f3eaeecbfabbeb4f591acb /Lib/email/Utils.py | |
parent | 235c8eba62f1ecfb5beb1be0f692de3a07ef4ab1 (diff) | |
download | cpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.zip cpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.tar.gz cpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.tar.bz2 |
Update to Python 2.3, getting rid of backward compatiblity crud.
Diffstat (limited to 'Lib/email/Utils.py')
-rw-r--r-- | Lib/email/Utils.py | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/Lib/email/Utils.py b/Lib/email/Utils.py index a409e16..3a4bbc8 100644 --- a/Lib/email/Utils.py +++ b/Lib/email/Utils.py @@ -1,17 +1,16 @@ -# Copyright (C) 2001,2002 Python Software Foundation -# Author: barry@zope.com (Barry Warsaw) +# Copyright (C) 2001-2004 Python Software Foundation +# Author: barry@python.org (Barry Warsaw) -"""Miscellaneous utilities. -""" +"""Miscellaneous utilities.""" -import time -import socket +import os import re +import time +import base64 import random -import os +import socket import warnings from cStringIO import StringIO -from types import ListType from email._parseaddr import quote from email._parseaddr import AddressList as _AddressList @@ -21,30 +20,7 @@ from email._parseaddr import mktime_tz from email._parseaddr import parsedate as _parsedate from email._parseaddr import parsedate_tz as _parsedate_tz -try: - True, False -except NameError: - True = 1 - False = 0 - -try: - from quopri import decodestring as _qdecode -except ImportError: - # Python 2.1 doesn't have quopri.decodestring() - def _qdecode(s): - import quopri as _quopri - - if not s: - return s - infp = StringIO(s) - outfp = StringIO() - _quopri.decode(infp, outfp) - value = outfp.getvalue() - if not s.endswith('\n') and value.endswith('\n'): - return value[:-1] - return value - -import base64 +from quopri import decodestring as _qdecode # Intrapackage imports from email.Encoders import _bencode, _qencode @@ -140,7 +116,7 @@ def decode(s): # Intra-package import here to avoid circular import problems. from email.Header import decode_header L = decode_header(s) - if not isinstance(L, ListType): + if not isinstance(L, list): # s wasn't decoded return s |