r""" >>> import io >>> read_decimalnl_short(io.BytesIO(b"1234\n56")) 1234 >>> read_decimalnl_short(io.BytesIO(b"1234L\n56")) Traceback (most recent call last): ... ValueError: invalid literal for int() with base 10: b'1234L'
(f)
| 748 | |
| 749 | |
| 750 | def read_decimalnl_short(f): |
| 751 | r""" |
| 752 | >>> import io |
| 753 | >>> read_decimalnl_short(io.BytesIO(b"1234\n56")) |
| 754 | 1234 |
| 755 | |
| 756 | >>> read_decimalnl_short(io.BytesIO(b"1234L\n56")) |
| 757 | Traceback (most recent call last): |
| 758 | ... |
| 759 | ValueError: invalid literal for int() with base 10: b'1234L' |
| 760 | """ |
| 761 | |
| 762 | s = read_stringnl(f, decode=False, stripquotes=False) |
| 763 | |
| 764 | # There's a hack for True and False here. |
| 765 | if s == b"00": |
| 766 | return False |
| 767 | elif s == b"01": |
| 768 | return True |
| 769 | |
| 770 | return int(s) |
| 771 | |
| 772 | def read_decimalnl_long(f): |
| 773 | r""" |
nothing calls this directly
no test coverage detected
searching dependent graphs…