diff --git a/bin/autojump_utils.py b/bin/autojump_utils.py index bac2f37..949b4fd 100644 --- a/bin/autojump_utils.py +++ b/bin/autojump_utils.py @@ -172,8 +172,12 @@ def sanitize(directories): def second(xs): it = iter(xs) try: - it.next() - return it.next() + if is_python2(): + it.next() + return it.next() + elif is_python3(): + next(it) + return next(it) except StopIteration: return None diff --git a/tests/autojump_utils_test.py b/tests/autojump_utils_test.py index 811adbf..42dd7f5 100644 --- a/tests/autojump_utils_test.py +++ b/tests/autojump_utils_test.py @@ -24,6 +24,7 @@ from autojump_utils import unico if is_python3(): os.getcwdu = os.getcwd + xrange = range def u(string):