summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-07-22 17:12:49 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-07-22 17:12:49 -0500
commit4a46412bf6007356775657e4f0bc452564dec2d1 (patch)
treea577be8345803d2c7429517a1dc61e51e15568f8 /src
parent473106fee1ec4fcc9e2dde55c821effcd34e8a97 (diff)
downloadflake8-4a46412bf6007356775657e4f0bc452564dec2d1.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/flake8/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flake8/utils.py b/src/flake8/utils.py
index f432dac..1e1eaa0 100644
--- a/src/flake8/utils.py
+++ b/src/flake8/utils.py
@@ -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)