mirror of https://github.com/MagicStack/uvloop.git
Activate debug mode when `-X dev` is used
This commit is contained in:
parent
8e42921d7b
commit
637a77a3a4
|
@ -116,6 +116,7 @@ cdef os_fspath = os.fspath
|
|||
cdef stat_S_ISSOCK = stat.S_ISSOCK
|
||||
|
||||
cdef sys_ignore_environment = sys.flags.ignore_environment
|
||||
cdef sys_dev_mode = sys.flags.dev_mode
|
||||
cdef sys_exc_info = sys.exc_info
|
||||
cdef sys_set_coroutine_wrapper = getattr(sys, 'set_coroutine_wrapper', None)
|
||||
cdef sys_get_coroutine_wrapper = getattr(sys, 'get_coroutine_wrapper', None)
|
||||
|
|
|
@ -223,8 +223,9 @@ cdef class Loop:
|
|||
return main_thread_id == PyThread_get_thread_ident()
|
||||
|
||||
def __init__(self):
|
||||
self.set_debug((not sys_ignore_environment
|
||||
and bool(os_environ.get('PYTHONASYNCIODEBUG'))))
|
||||
self.set_debug(
|
||||
sys_dev_mode or (not sys_ignore_environment
|
||||
and bool(os_environ.get('PYTHONASYNCIODEBUG'))))
|
||||
|
||||
def __dealloc__(self):
|
||||
if self._running == 1:
|
||||
|
|
Loading…
Reference in New Issue