mitogen: Configure mitogen.core.now based on sys.version_info

Simplify work of static type checkers, LSPs, etc.
pull/1415/head
Alex Willmer 4 days ago
parent 94b2f5d8d6
commit 67264ed174

@ -102,6 +102,11 @@ if sys.version_info >= (3, 4):
else:
import imp
if sys.version_info >= (3, 3):
now = time.monotonic
else:
now = time.time
if sys.version_info >= (2, 5):
def _update_linecache(path, data): pass
else:
@ -402,10 +407,6 @@ def to_text(o):
return UnicodeType(o)
# Documented in api.rst to work around Sphinx limitation.
now = getattr(time, 'monotonic', time.time)
# Python 2.4
try:
all, any = all, any

Loading…
Cancel
Save