Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only install monotonic on python2 #583

Merged
merged 6 commits into from Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions eventlet/__init__.py
Expand Up @@ -21,8 +21,11 @@
# Helpful when CPython < 3.5 on Linux blocked in `os.waitpid(-1)` before first use of hub.
# Example: gunicorn
# https://github.com/eventlet/eventlet/issues/401#issuecomment-327500352
import monotonic
del monotonic
try:
import monotonic
del monotonic
except ImportError:
pass

connect = convenience.connect
listen = convenience.listen
Expand Down
8 changes: 6 additions & 2 deletions eventlet/hubs/hub.py
Expand Up @@ -22,7 +22,11 @@ def alarm_signal(seconds):
import eventlet.hubs
from eventlet.hubs import timer
from eventlet.support import greenlets as greenlet, clear_sys_exc_info
import monotonic
try:
from monotonic import monotonic
except ImportError:
from time import monotonic

import six

g_prevent_multiple_readers = True
Expand Down Expand Up @@ -120,7 +124,7 @@ def __init__(self, clock=None):
self.closed = []

if clock is None:
clock = monotonic.monotonic
clock = monotonic
self.clock = clock

self.greenlet = greenlet.greenlet(self.run)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -18,7 +18,7 @@
'dnspython >= 1.15.0',
'enum34;python_version<"3.4"',
'greenlet >= 0.3',
'monotonic >= 1.4',
'monotonic >= 1.4;python_version<"3.3"',
temoto marked this conversation as resolved.
Show resolved Hide resolved
'six >= 1.10.0',
),
zip_safe=False,
Expand Down