diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-12-16 20:51:07 +0100 |
---|---|---|
committer | Ian Lee <IanLee1521@gmail.com> | 2014-12-18 00:39:05 -0800 |
commit | 497f1db5d142ddb891504d2513d52c5f195c05ac (patch) | |
tree | 860a2cb5c331ee0e5af44d5c93f62386fecc27bb /pep8.py | |
parent | e73ce7d2001f9cd3d1d6acdd1040b7e6abca77fe (diff) | |
download | pep8-497f1db5d142ddb891504d2513d52c5f195c05ac.tar.gz |
Do not skip physical checks if the newline is escaped; issue #319issue319
Diffstat (limited to 'pep8.py')
-rwxr-xr-x | pep8.py | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1238,14 +1238,12 @@ def filename_match(filename, patterns, default=True): return any(fnmatch(filename, pattern) for pattern in patterns) +def _is_eol_token(token): + return token[0] in NEWLINE or token[4][token[3][1]:].lstrip() == '\\\n' if COMMENT_WITH_NL: - def _is_eol_token(token): - return (token[0] in NEWLINE or - (token[0] == tokenize.COMMENT and token[1] == token[4])) -else: - def _is_eol_token(token): - return token[0] in NEWLINE - + def _is_eol_token(token, _eol_token=_is_eol_token): + return _eol_token(token) or (token[0] == tokenize.COMMENT and + token[1] == token[4]) ############################################################################## # Framework to run all checks |