Skip to content

Commit 3690fb3

Browse files
committed
Redefine new_licenses and old_licenses #29
* In '_license_diff()', reverted to prior definitions of 'new_licenses' and 'old_licenses' by including "or []". Signed-off-by: John M. Horan <johnmhoran@gmail.com>
1 parent 76131bb commit 3690fb3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/deltacode/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ def _license_diff(self, cutoff_score=50):
181181
'license info removed', 'license info added' or 'license change' if
182182
there has been a license change and depending on the nature of that change.
183183
"""
184-
new_licenses = self.new_file.licenses
185-
old_licenses = self.old_file.licenses
184+
new_licenses = self.new_file.licenses or []
185+
old_licenses = self.old_file.licenses or []
186186

187-
if new_licenses and not old_licenses:
187+
if self.new_file.licenses and not self.old_file.licenses:
188188
self.category = 'license info added'
189-
if not new_licenses and old_licenses:
189+
if not self.new_file.licenses and self.old_file.licenses:
190190
self.category = 'license info removed'
191191

192192
new_keys = set(l.key for l in new_licenses if l.score >= cutoff_score)

0 commit comments

Comments
 (0)