Skip to content

Commit 4e53b4e

Browse files
committed
Use isinstance instead of type comparison
1 parent d3a1cfb commit 4e53b4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bagit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def _load_tag_file(tag_file_name):
657657
tags[name] = value
658658
continue
659659

660-
if not type(tags[name]) is list:
660+
if not isinstance(tags[name], list):
661661
tags[name] = [tags[name], value]
662662
else:
663663
tags[name].append(value)
@@ -711,7 +711,7 @@ def _make_tag_file(bag_info_path, bag_info):
711711
headers.sort()
712712
with open(bag_info_path, 'w') as f:
713713
for h in headers:
714-
if type(bag_info[h]) == list:
714+
if isinstance(bag_info[h], list):
715715
for val in bag_info[h]:
716716
f.write("%s: %s\n" % (h, val))
717717
else:

0 commit comments

Comments
 (0)