Attempt to convert string to an integer value.
(s: str, /)
| 56 | |
| 57 | |
| 58 | def try_read_int(s: str, /) -> Optional[int]: |
| 59 | """Attempt to convert string to an integer value. |
| 60 | """ |
| 61 | |
| 62 | try: |
| 63 | val = read_int(s) |
| 64 | except (ValueError, TypeError): |
| 65 | val = None |
| 66 | |
| 67 | return val |
| 68 | |
| 69 | |
| 70 | InsnLike = Union[CsInsn, InvalidInsn] |
no test coverage detected