Merge branch 'master' into 4232-slow-pipes-n-jobs
[arvados.git] / sdk / python / arvados / util.py
index 5014055c0eebe7434b22f70f3c1a20c094bebe75..79692ae7084827257844b1a7d268cdaf667d3629 100644 (file)
@@ -24,7 +24,7 @@ def clear_tmpdir(path=None):
     Ensure the given directory (or TASK_TMPDIR if none given)
     exists and is empty.
     """
-    if path == None:
+    if path is None:
         path = arvados.current_task().tmpdir
     if os.path.exists(path):
         p = subprocess.Popen(['rm', '-rf', path])
@@ -349,8 +349,8 @@ def is_hex(s, *length_args):
     """
     num_length_args = len(length_args)
     if num_length_args > 2:
-        raise ArgumentError("is_hex accepts up to 3 arguments ({} given)".
-                            format(1 + num_length_args))
+        raise errors.ArgumentError("is_hex accepts up to 3 arguments ({} given)"
+                                   .format(1 + num_length_args))
     elif num_length_args == 2:
         good_len = (length_args[0] <= len(s) <= length_args[1])
     elif num_length_args == 1: