MCPcopy Index your code
hub / github.com/python/cpython / check_status

Function check_status

Lib/wsgiref/validate.py:372–384  ·  view source on GitHub ↗
(status)

Source from the content-addressed store, hash-verified

370 % (wsgi_errors, attr))
371
372def check_status(status):
373 status = check_string_type(status, "Status")
374 # Implicitly check that we can turn it into an integer:
375 status_code = status.split(None, 1)[0]
376 assert_(len(status_code) == 3,
377 "Status codes must be three characters: %r" % status_code)
378 status_int = int(status_code)
379 assert_(status_int >= 100, "Status code is invalid: %r" % status_int)
380 if len(status) < 4 or status[3] != ' ':
381 warnings.warn(
382 "The status string (%r) should be a three-digit integer "
383 "followed by a single space and a status explanation"
384 % status, WSGIWarning)
385
386def check_headers(headers):
387 assert_(type(headers) is list,

Callers 1

start_response_wrapperFunction · 0.85

Calls 4

check_string_typeFunction · 0.85
assert_Function · 0.85
splitMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…