Check for alternate_separator only when truthy

In the case where alternate separator is None, we use '' which will
always be in any string. We want to skip that case.

Also we only run our tests on AppVeyor, not all of our testenvs.
This commit is contained in:
Ian Cordasco 2016-07-22 17:12:49 -05:00
parent 473106fee1
commit 4a46412bf6
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 3 additions and 2 deletions

View file

@ -5,4 +5,4 @@ install:
build: off
test_script:
- python -m tox
- python -m tox -e py27,py33,py34,py35

View file

@ -59,7 +59,8 @@ def normalize_path(path, parent=os.curdir):
separator = os.path.sep
# NOTE(sigmavirus24): os.path.altsep may be None
alternate_separator = os.path.altsep or ''
if separator in path or alternate_separator in path:
if separator in path or (alternate_separator and
alternate_separator in path):
path = os.path.abspath(os.path.join(parent, path))
return path.rstrip(separator + alternate_separator)