summaryrefslogtreecommitdiff
path: root/paste/lint.py
diff options
context:
space:
mode:
authorIan Bicking <ian@ianbicking.org>2005-05-20 15:28:50 +0000
committerIan Bicking <ian@ianbicking.org>2005-05-20 15:28:50 +0000
commit9e302a89ae0185daa556d1bc7a064e97a8d1c516 (patch)
tree5532b554cbcf43437e9a6f6de7977c0ca8e1039b /paste/lint.py
parent60c761d75a4fd931dd3ca2edac1ceece373e324d (diff)
downloadpaste-git-9e302a89ae0185daa556d1bc7a064e97a8d1c516.tar.gz
Make sure status codes are 3 chars
Diffstat (limited to 'paste/lint.py')
-rw-r--r--paste/lint.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/lint.py b/paste/lint.py
index a52a227..9cb06ea 100644
--- a/paste/lint.py
+++ b/paste/lint.py
@@ -221,7 +221,10 @@ def check_status(status):
assert type(status) is StringType, (
"Status must be a string (not %r)" % status)
# Implicitly check that we can turn it into an integer:
- status_int = int(status.split(None, 1)[0])
+ status_code = status.split(None, 1)[0]
+ assert len(status_code) == 3, (
+ "Status codes must be three characters: %r" % status_code)
+ status_int = int(status_code)
assert status_int >= 100, "Status code is invalid: %r" % status_int
def check_headers(headers):