Skip to content

Commit 637a77a

Browse files
Jackenmenfantix
authored andcommitted
Activate debug mode when -X dev is used
1 parent 8e42921 commit 637a77a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

uvloop/includes/stdlib.pxi

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ cdef os_fspath = os.fspath
116116
cdef stat_S_ISSOCK = stat.S_ISSOCK
117117

118118
cdef sys_ignore_environment = sys.flags.ignore_environment
119+
cdef sys_dev_mode = sys.flags.dev_mode
119120
cdef sys_exc_info = sys.exc_info
120121
cdef sys_set_coroutine_wrapper = getattr(sys, 'set_coroutine_wrapper', None)
121122
cdef sys_get_coroutine_wrapper = getattr(sys, 'get_coroutine_wrapper', None)

uvloop/loop.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ cdef class Loop:
223223
return main_thread_id == PyThread_get_thread_ident()
224224

225225
def __init__(self):
226-
self.set_debug((not sys_ignore_environment
227-
and bool(os_environ.get('PYTHONASYNCIODEBUG'))))
226+
self.set_debug(
227+
sys_dev_mode or (not sys_ignore_environment
228+
and bool(os_environ.get('PYTHONASYNCIODEBUG'))))
228229

229230
def __dealloc__(self):
230231
if self._running == 1:

0 commit comments

Comments
 (0)