Fix type checks in arv-copy recursive collection copying.
[arvados.git] / sdk / python / arvados / commands / arv_copy.py
index 09cd9d42e3bb8b6969501f01c3800b2ddca68d74..c5749cce5e860c5ee251f8f3bfa5616befa2c7d4 100755 (executable)
@@ -192,7 +192,7 @@ def api_for_instance(instance_name):
 def check_git_availability():
     try:
         arvados.util.run_command(['git', '--help'])
-    except:
+    except Exception:
         abort('git command is not available. Please ensure git is installed.')
 
 # copy_pipeline_instance(pi_uuid, src, dst, args)
@@ -329,9 +329,9 @@ def copy_collections(obj, src, dst, args):
         obj = arvados.util.portable_data_hash_pattern.sub(copy_collection_fn, obj)
         obj = arvados.util.collection_uuid_pattern.sub(copy_collection_fn, obj)
         return obj
-    elif type(obj) == dict:
+    elif isinstance(obj, dict):
         return {v: copy_collections(obj[v], src, dst, args) for v in obj}
-    elif type(obj) == list:
+    elif isinstance(obj, list):
         return [copy_collections(v, src, dst, args) for v in obj]
     return obj