mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
asyncio, Tulip issue #136: Add get/set_debug() methods to BaseEventLoopTests.
Add also a PYTHONASYNCIODEBUG environment variable to debug coroutines since Python startup, to be able to debug coroutines defined directly in the asyncio module.
This commit is contained in:
parent
f4558e8b54
commit
7ef60cd8c2
8 changed files with 83 additions and 5 deletions
|
|
@ -12,6 +12,8 @@
|
|||
import functools
|
||||
import inspect
|
||||
import linecache
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
import weakref
|
||||
|
||||
|
|
@ -28,7 +30,8 @@
|
|||
# before you define your coroutines. A downside of using this feature
|
||||
# is that tracebacks show entries for the CoroWrapper.__next__ method
|
||||
# when _DEBUG is true.
|
||||
_DEBUG = False
|
||||
_DEBUG = (not sys.flags.ignore_environment
|
||||
and bool(os.environ.get('PYTHONASYNCIODEBUG')))
|
||||
|
||||
|
||||
class CoroWrapper:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue