From 4e53b4eb48323e48614eed61175019d067ef69cb Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Tue, 7 Jul 2015 15:54:58 -0400 Subject: [PATCH] Use isinstance instead of type comparison --- bagit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bagit.py b/bagit.py index 6fc79f0..be9504d 100755 --- a/bagit.py +++ b/bagit.py @@ -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) @@ -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: