From: Oleg Broytman Date: Fri, 21 Feb 2014 19:48:18 +0000 (+0400) Subject: Use list/tuple directly instead of using types module X-Git-Tag: v2.3.7~3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=0b719d14998b07b5c1ee9043bb3a356501c2bcb8;p=mimedecode.git Use list/tuple directly instead of using types module --- diff --git a/mimedecode.py b/mimedecode.py index 9a23b7f..569559b 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -47,11 +47,10 @@ def _decode_header(s): """Return a decoded string according to RFC 2047. NOTE: This is almost the same as email.Utils.decode. """ - from types import ListType import email.Header L = email.Header.decode_header(s) - if not isinstance(L, ListType): + if not isinstance(L, list): # s wasn't decoded return s @@ -87,8 +86,7 @@ def decode_header_param(msg, header, param): if msg.has_key(header): value = msg.get_param(param, header=header) if value: - from types import TupleType - if isinstance(value, TupleType): + if isinstance(value, tuple): new_value = _decode_header_param(value) else: new_value = _decode_header(value)