mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 18:56:53 +00:00
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:
parent
473106fee1
commit
4a46412bf6
2 changed files with 3 additions and 2 deletions
|
|
@ -5,4 +5,4 @@ install:
|
|||
build: off
|
||||
|
||||
test_script:
|
||||
- python -m tox
|
||||
- python -m tox -e py27,py33,py34,py35
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue