Skip to content

Commit dff3033

Browse files
committed
The logical checks can return None; issue #250
1 parent af91d98 commit dff3033

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Changelog
2020
* Fix behaviour when ``exclude`` is in the configuration file and
2121
the current directory is not the project directory. (Issue #247)
2222

23+
* The logical checks can return ``None`` instead of an empty iterator.
24+
(Issue #250)
25+
2326

2427
1.4.6 (2013-07-02)
2528
------------------

pep8.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,10 +1345,10 @@ def check_logical(self):
13451345
for name, check, argument_names in self._logical_checks:
13461346
if self.verbose >= 4:
13471347
print(' ' + name)
1348-
for result in self.run_check(check, argument_names):
1349-
offset, text = result
1348+
for result in self.run_check(check, argument_names) or ():
1349+
(offset, text) = result
13501350
if isinstance(offset, tuple):
1351-
orig_number, orig_offset = offset
1351+
(orig_number, orig_offset) = offset
13521352
else:
13531353
for token_offset, token in self.mapping:
13541354
if offset >= token_offset:

0 commit comments

Comments
 (0)