(input)
| 7 | |
| 8 | |
| 9 | def read_tnetstring(input): |
| 10 | # tnetstring throw a ValueError on EOF, which is hard to catch |
| 11 | # because they raise ValueErrors for a couple of other reasons. |
| 12 | # Check for EOF to avoid this. |
| 13 | if not input.read(1): |
| 14 | return None |
| 15 | else: |
| 16 | input.seek(-1, 1) |
| 17 | return tnetstring.load(input) |
| 18 | |
| 19 | |
| 20 | @click.command() |