handle empty message params correctly

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3700 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-01-31 12:43:39 +00:00
parent 63e61d5088
commit 137c2f88f9

View file

@ -129,4 +129,7 @@ def getText(msg):
return msg.get_payload(decode=True).decode(getCharset(msg))
def getCharset(msg):
return dict(msg.get_params()).get('charset') or 'ISO8859-1'
params = msg.get_params()
if params:
return dict(params).get('charset') or 'ISO8859-1'
return 'ISO8859-1'