mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Add xrange() and fix second() for Python3.
This commit is contained in:
parent
921b52e9d5
commit
62c0877479
@ -172,8 +172,12 @@ def sanitize(directories):
|
|||||||
def second(xs):
|
def second(xs):
|
||||||
it = iter(xs)
|
it = iter(xs)
|
||||||
try:
|
try:
|
||||||
it.next()
|
if is_python2():
|
||||||
return it.next()
|
it.next()
|
||||||
|
return it.next()
|
||||||
|
elif is_python3():
|
||||||
|
next(it)
|
||||||
|
return next(it)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ from autojump_utils import unico
|
|||||||
|
|
||||||
if is_python3():
|
if is_python3():
|
||||||
os.getcwdu = os.getcwd
|
os.getcwdu = os.getcwd
|
||||||
|
xrange = range
|
||||||
|
|
||||||
|
|
||||||
def u(string):
|
def u(string):
|
||||||
|
Loading…
Reference in New Issue
Block a user