diff options
| author | postmasters <namnguyen@google.com> | 2019-04-10 14:18:47 -0700 |
|---|---|---|
| committer | postmasters <namnguyen@google.com> | 2019-04-10 19:19:44 -0700 |
| commit | 15d87c252ba6e20a0da4cf667f899a2e7bca48fe (patch) | |
| tree | e63f4adbab8d2c3a4cb9f7ffe3965a7c63ad5d6a /webtest | |
| parent | ff077e24b83efb35dd82412f4f4ff0c2122b9074 (diff) | |
| download | webtest-15d87c252ba6e20a0da4cf667f899a2e7bca48fe.tar.gz | |
Use truth test instead of length == 0
`length` is initially set to `None`. When there is no `Content-Length`
header, `length` will still be `None`. So the test `length == 0` is not
entirely correct.
Diffstat (limited to 'webtest')
| -rw-r--r-- | webtest/lint.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/webtest/lint.py b/webtest/lint.py index 8d28103..a12a923 100644 --- a/webtest/lint.py +++ b/webtest/lint.py @@ -534,7 +534,7 @@ def check_content_type(status, headers): if name.lower() == 'content-type': if code not in NO_MESSAGE_TYPE: return - elif length == 0: + elif not length: warnings.warn(("Content-Type header found in a %s response, " "which not return content.") % code, WSGIWarning) |
