Invoke raise_error from the extension to demonstrate error handling.
()
| 34 | |
| 35 | |
| 36 | def run_raise_error() -> None: |
| 37 | """Invoke raise_error from the extension to demonstrate error handling.""" |
| 38 | print("=========== Example 3: raise_error ===========") |
| 39 | try: |
| 40 | my_ffi_extension.raise_error("This is an error") |
| 41 | except RuntimeError: |
| 42 | traceback.print_exc() |
| 43 | |
| 44 | |
| 45 | def run_int_pair() -> None: |