mitogen: Provide mitogen.core.next based on sys.version_info

Simplify work of static type checkers, LSPs, etc.
pull/1415/head
Alex Willmer 4 days ago
parent d1ee8c788f
commit 55bd5fd7a4

@ -124,6 +124,11 @@ else:
def str_rpartition(s, sep): return _part(s, sep, s.rfind) or (u'', u'', s)
def bytes_partition(s, sep): return _part(s, sep, s.find) or (s, '', '')
if sys.version_info >= (2, 6):
next = next
else:
def next(it): return it.next()
if sys.version_info >= (2, 5):
def _update_linecache(path, data): pass
else:
@ -222,11 +227,6 @@ else:
AnyTextType = (BytesType, UnicodeType)
try:
next = next
except NameError:
next = lambda it: it.next()
# #550: prehistoric WSL did not advertise itself in uname output.
try:
fp = open('/proc/sys/kernel/osrelease')

Loading…
Cancel
Save