Parse a non-negative hexadecimal integer from a string.
(s: str)
| 865 | |
| 866 | |
| 867 | def parse_hex_int(s: str) -> int: |
| 868 | """Parse a non-negative hexadecimal integer from a string.""" |
| 869 | if HEXDIGITS.fullmatch(s) is None: |
| 870 | raise ValueError("not a hexadecimal integer: %r" % s) |
| 871 | return int(s, 16) |
| 872 | |
| 873 | |
| 874 | def is_transfer_encoding_chunked(headers: httputil.HTTPHeaders) -> bool: |