Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ matrix:
python: "3.6"
env: BUILD=tests

- os: linux
dist: trusty
sudo: false
language: python
python: "3.7-dev"
env: BUILD=tests

- os: linux
dist: trusty
branches: {only: [releases]}
Expand Down
43 changes: 23 additions & 20 deletions uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -974,28 +974,31 @@ cdef class Loop:
enabled = bool(enabled)
if self._coroutine_wrapper_set == enabled:
return

wrapper = aio_debug_wrapper
current_wrapper = sys_get_coroutine_wrapper()

if enabled:
if current_wrapper not in (None, wrapper):
warnings.warn(
"loop.set_debug(True): cannot set debug coroutine "
"wrapper; another wrapper is already set %r" %
current_wrapper, RuntimeWarning)
else:
sys_set_coroutine_wrapper(wrapper)
self._coroutine_wrapper_set = True

if sys_version_info >= (3, 7, 0):
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange. Why not if sys_version_info < (3, 7, 0)?

else:
if current_wrapper not in (None, wrapper):
warnings.warn(
"loop.set_debug(False): cannot unset debug coroutine "
"wrapper; another wrapper was set %r" %
current_wrapper, RuntimeWarning)
wrapper = aio_debug_wrapper
current_wrapper = sys_get_coroutine_wrapper()

if enabled:
if current_wrapper not in (None, wrapper):
warnings.warn(
"loop.set_debug(True): cannot set debug coroutine "
"wrapper; another wrapper is already set %r" %
current_wrapper, RuntimeWarning)
else:
sys_set_coroutine_wrapper(wrapper)
self._coroutine_wrapper_set = True
else:
sys_set_coroutine_wrapper(None)
self._coroutine_wrapper_set = False
if current_wrapper not in (None, wrapper):
warnings.warn(
"loop.set_debug(False): cannot unset debug coroutine "
"wrapper; another wrapper was set %r" %
current_wrapper, RuntimeWarning)
else:
sys_set_coroutine_wrapper(None)
self._coroutine_wrapper_set = False

cdef _create_server(self, system.sockaddr *addr,
object protocol_factory,
Expand Down