Skip to content

Commit

Permalink
Activate debug mode when -X dev is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen authored and fantix committed Sep 2, 2022
1 parent 8e42921 commit 637a77a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions uvloop/includes/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 637a77a

Please sign in to comment.