This website works better with JavaScript.
Home
Explore
Help
Sign In
isprogram
/
autojump
mirror of
https://github.com/wting/autojump.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Projects
0
Releases
53
Wiki
Activity
Browse Source
Add xrange() and fix second() for Python3.
pull/307/head
William Ting
10 years ago
parent
921b52e9d5
commit
62c0877479
2 changed files
with
7 additions
and
2 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-2
bin/autojump_utils.py
+1
-0
tests/autojump_utils_test.py
+ 6
- 2
bin/autojump_utils.py
View File
@ -172,8 +172,12 @@ def sanitize(directories):
def
second
(
xs
)
:
def
second
(
xs
)
:
it
=
iter
(
xs
)
it
=
iter
(
xs
)
try
:
try
:
it
.
next
(
)
return
it
.
next
(
)
if
is_python2
(
)
:
it
.
next
(
)
return
it
.
next
(
)
elif
is_python3
(
)
:
next
(
it
)
return
next
(
it
)
except
StopIteration
:
except
StopIteration
:
return
None
return
None
+ 1
- 0
tests/autojump_utils_test.py
View File
@ -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
)
:
Write
Preview
Loading…
Cancel
Save