Skip to content

Commit 070c1f3

Browse files
jk-ozlabsstephenfin
authored andcommitted
parsemail: Fix return value for find_content error case
If we fail to decode a message payload, we'll fail with the following: Traceback (most recent call last): File "./patchwork/bin/parsemail.py", line 563, in <module> sys.exit(main(sys.argv)) File "./patchwork/bin/parsemail.py", line 553, in main return parse_mail(mail, args['list_id']) File "./patchwork/bin/parsemail.py", line 464, in parse_mail (patch, comment, filenames) = find_content(project, mail) ValueError: need more than 2 values to unpack - as the error condition for find_content only returns a 2-tuple. This change fixes the error case to the 3-tuple return type. Signed-off-by: Jeremy Kerr <[email protected]> Acked-by: Stephen Finucane <[email protected]>
1 parent 7ffe5d7 commit 070c1f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patchwork/bin/parsemail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def find_content(project, mail):
231231

232232
# Could not find a valid decoded payload. Fail.
233233
if payload is None:
234-
return (None, None)
234+
return (None, None, None)
235235

236236
if subtype in ['x-patch', 'x-diff']:
237237
patchbuf = payload

0 commit comments

Comments
 (0)