Skip to content

Commit 7d26b0d

Browse files
committed
Fix as_posix for python 2.
1 parent 32f9315 commit 7d26b0d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test_git_archive_all.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ def makedirs(p):
2626

2727

2828
def as_posix(p):
29-
if sys.platform.startswith('win32'):
30-
return str(p).replace('\\', '/')
29+
if sys.version_info < (3,):
30+
str_p = unicode(p)
3131
else:
32-
return str(p)
32+
str_p = str(p)
33+
34+
if sys.platform.startswith('win32'):
35+
str_p = str_p.replace('\\', '/')
36+
37+
return str_p
3338

3439

3540
@pytest.fixture

0 commit comments

Comments
 (0)