Skip to content

Commit

Permalink
Use isinstance instead of type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
acdha committed Jul 7, 2015
1 parent d3a1cfb commit 4e53b4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bagit.py
Expand Up @@ -657,7 +657,7 @@ def _load_tag_file(tag_file_name):
tags[name] = value
continue

if not type(tags[name]) is list:
if not isinstance(tags[name], list):
tags[name] = [tags[name], value]
else:
tags[name].append(value)
Expand Down Expand Up @@ -711,7 +711,7 @@ def _make_tag_file(bag_info_path, bag_info):
headers.sort()
with open(bag_info_path, 'w') as f:
for h in headers:
if type(bag_info[h]) == list:
if isinstance(bag_info[h], list):
for val in bag_info[h]:
f.write("%s: %s\n" % (h, val))
else:
Expand Down

0 comments on commit 4e53b4e

Please sign in to comment.