patchutils.py: Simplify access of optional dict values.

This commit is contained in:
Sebastian Lackner 2016-03-22 08:22:19 +01:00
parent b0cbb8bda2
commit f21c3bc221

View File

@ -54,8 +54,8 @@ class PatchObject(object):
self.patch_author = header['author']
self.patch_email = header['email']
self.patch_subject = header['subject']
self.patch_revision = header['revision'] if header.has_key('revision') else 1
self.signed_off_by = header['signedoffby'] if header.has_key('signedoffby') else []
self.patch_revision = header.get('revision', 1)
self.signed_off_by = header.get('signedoffby', [])
self.filename = filename
self.offset_begin = None