diff --git a/uvloop/includes/stdlib.pxi b/uvloop/includes/stdlib.pxi index 3c27687..a5ef795 100644 --- a/uvloop/includes/stdlib.pxi +++ b/uvloop/includes/stdlib.pxi @@ -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) diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx index 86141cb..05f9f0e 100644 --- a/uvloop/loop.pyx +++ b/uvloop/loop.pyx @@ -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: