summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-mime.py2
-rwxr-xr-xtools/mock-meta.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/tools/make-mime.py b/tools/make-mime.py
index 12727126..f6a72044 100755
--- a/tools/make-mime.py
+++ b/tools/make-mime.py
@@ -22,7 +22,7 @@ def file_content_type(text):
try:
filename, content_type = text.split(":", 1)
return (open(filename, 'r'), filename, content_type.strip())
- except:
+ except ValueError:
raise argparse.ArgumentError("Invalid value for %r" % (text))
diff --git a/tools/mock-meta.py b/tools/mock-meta.py
index a0d99441..95fc4659 100755
--- a/tools/mock-meta.py
+++ b/tools/mock-meta.py
@@ -259,7 +259,10 @@ class MetaDataHandler(object):
try:
key_id = int(mybe_key)
key_name = key_ids[key_id]
- except:
+ except ValueError:
+ raise WebException(hclient.BAD_REQUEST,
+ "%s: not an integer" % mybe_key)
+ except KeyError:
raise WebException(hclient.BAD_REQUEST,
"Unknown key id %r" % mybe_key)
# Extract the possible sub-params