patchutils.py: Avoid runtime error when parsing patch without author information.

This commit is contained in:
Sebastian Lackner 2016-04-02 21:02:23 +02:00
parent 6eb36a3a28
commit 8bed2e61a6

View File

@ -51,9 +51,9 @@ class CParserError(RuntimeError):
class PatchObject(object):
def __init__(self, filename, header):
self.patch_author = header['author']
self.patch_email = header['email']
self.patch_subject = header['subject']
self.patch_author = header.get('author', None)
self.patch_email = header.get('email', None)
self.patch_subject = header.get('subject', None)
self.patch_revision = header.get('revision', 1)
self.signed_off_by = header.get('signedoffby', [])