diff options
author | ianb <devnull@localhost> | 2005-05-20 15:28:50 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2005-05-20 15:28:50 +0000 |
commit | 274c7f48a3154e01428da6fc0c249dddf81ae7f9 (patch) | |
tree | 5532b554cbcf43437e9a6f6de7977c0ca8e1039b /paste/lint.py | |
parent | c532e16d686147e7d9a1fd408b13b04c3e8add86 (diff) | |
download | paste-274c7f48a3154e01428da6fc0c249dddf81ae7f9.tar.gz |
Make sure status codes are 3 chars
Diffstat (limited to 'paste/lint.py')
-rw-r--r-- | paste/lint.py | 5 |
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): |