MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / WTF

Class WTF

python/pythonmonkey/lib/wtfpm.py:18–42  ·  view source on GitHub ↗

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()) ```

Source from the content-addressed store, hash-verified

16
17
18class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected