remove warning message to console on empty user-data

Previously, if the user did not provide any user-data, then
a warning would be emitted like:
  2012-06-28 17:10:24,751 - __init__.py[WARNING]: Unhandled
     non-multipart userdata ''

This just avoids the warning if there was no userdata.
This commit is contained in:
Scott Moser 2012-06-28 13:10:56 -04:00
parent fac802e19f
commit 780cf2d7ca
1 changed files with 1 additions and 1 deletions

View File

@ -607,7 +607,7 @@ def partwalker_callback(pdata, ctype, filename, payload):
pdata['handlercount'] = 0
partwalker_handle_handler(pdata, ctype, filename, payload)
return
if ctype not in pdata['handlers']:
if ctype not in pdata['handlers'] and payload:
if ctype == "text/x-not-multipart":
# Extract the first line or 24 bytes for displaying in the log
start = payload.split("\n", 1)[0][:24]