Небольшой штрих
parent
f8c956ab0b
commit
251303c380
|
@ -42,7 +42,7 @@ def detect_media_type(name):
|
||||||
else:
|
else:
|
||||||
return MediaType.UNKNOWN
|
return MediaType.UNKNOWN
|
||||||
def normalize_msg(tmpl, *args):
|
def normalize_msg(tmpl, *args):
|
||||||
msg = tmpl.decode(chardet.detect(tmpl)['encoding'])
|
msg = isinstance(tmpl, unicode) and tmpl or tmpl.decode(chardet.detect(tmpl)['encoding'])
|
||||||
arg_ = []
|
arg_ = []
|
||||||
for a in args:
|
for a in args:
|
||||||
if not isinstance(a, unicode): arg_.append(a.decode(chardet.detect(a)['encoding']))
|
if not isinstance(a, unicode): arg_.append(a.decode(chardet.detect(a)['encoding']))
|
||||||
|
|
Loading…
Reference in New Issue