Skip to content

Commit

Permalink
Fix as_posix for python 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentzo committed Nov 14, 2018
1 parent 32f9315 commit 7d26b0d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test_git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ def makedirs(p):


def as_posix(p):
if sys.platform.startswith('win32'):
return str(p).replace('\\', '/')
if sys.version_info < (3,):
str_p = unicode(p)
else:
return str(p)
str_p = str(p)

if sys.platform.startswith('win32'):
str_p = str_p.replace('\\', '/')

return str_p


@pytest.fixture
Expand Down

0 comments on commit 7d26b0d

Please sign in to comment.