From 0b719d14998b07b5c1ee9043bb3a356501c2bcb8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 21 Feb 2014 23:48:18 +0400 Subject: [PATCH] Use list/tuple directly instead of using types module --- mimedecode.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.39.2