WTFPythonMonkey to use as a Python context manager (`with`-statement) Usage: ```py from pythonmonkey.lib.wtfpm import WTF with WTF(): # the main entry point for the program utilizes PythonMonkey event-loop asyncio.run(pythonmonkey_main()) ```
| 16 | |
| 17 | |
| 18 | class WTF: |
| 19 | """ |
| 20 | WTFPythonMonkey to use as a Python context manager (`with`-statement) |
| 21 | |
| 22 | Usage: |
| 23 | ```py |
| 24 | from pythonmonkey.lib.wtfpm import WTF |
| 25 | |
| 26 | with WTF(): |
| 27 | # the main entry point for the program utilizes PythonMonkey event-loop |
| 28 | asyncio.run(pythonmonkey_main()) |
| 29 | ``` |
| 30 | """ |
| 31 | |
| 32 | def __enter__(self): |
| 33 | pass |
| 34 | |
| 35 | def __exit__(self, errType, errValue, traceback): |
| 36 | if errType is None: # no exception |
| 37 | return |
| 38 | elif issubclass(errType, KeyboardInterrupt): # except KeyboardInterrupt: |
| 39 | printTimersDebugInfo() |
| 40 | return True # exception suppressed |
| 41 | else: # other exceptions |
| 42 | return False |
nothing calls this directly
no outgoing calls
no test coverage detected