diff options
author | Ian Lee <IanLee1521@gmail.com> | 2014-12-13 19:08:06 -0800 |
---|---|---|
committer | Ian Lee <IanLee1521@gmail.com> | 2014-12-13 19:20:24 -0800 |
commit | e585618c224568c2f47d99ab615b32e5f821a633 (patch) | |
tree | 2305a0393c09286e1b7c38943d099eace32312bb /pep8.py | |
parent | 60ad926de0a3fdf1be534958d98debc88bc412f5 (diff) | |
download | pep8-e585618c224568c2f47d99ab615b32e5f821a633.tar.gz |
Don't crash if build_tokens_line() returns None; issue #306
Diffstat (limited to 'pep8.py')
-rwxr-xr-x | pep8.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1346,6 +1346,10 @@ class Checker(object): """Build a line from tokens and run all logical checks on it.""" self.report.increment_logical_line() mapping = self.build_tokens_line() + + if not mapping: + return + (start_row, start_col) = mapping[0][1] start_line = self.lines[start_row - 1] self.indent_level = expand_indent(start_line[:start_col]) |