summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 00:52:47 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 00:52:47 +0100
commitdff303308714da0da729d97f4f423541d9d33431 (patch)
treedda214fbae63c3980c975f1c6e3c84b2654ed593
parentaf91d986c091bec2972c38b9cae505ad2d6c762c (diff)
downloadpep8-dff303308714da0da729d97f4f423541d9d33431.tar.gz
The logical checks can return None; issue #250
-rw-r--r--CHANGES.txt3
-rwxr-xr-xpep8.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 034cc7f..96d879a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,9 @@ Changelog
* Fix behaviour when ``exclude`` is in the configuration file and
the current directory is not the project directory. (Issue #247)
+* The logical checks can return ``None`` instead of an empty iterator.
+ (Issue #250)
+
1.4.6 (2013-07-02)
------------------
diff --git a/pep8.py b/pep8.py
index 695add2..215bde2 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1345,10 +1345,10 @@ class Checker(object):
for name, check, argument_names in self._logical_checks:
if self.verbose >= 4:
print(' ' + name)
- for result in self.run_check(check, argument_names):
- offset, text = result
+ for result in self.run_check(check, argument_names) or ():
+ (offset, text) = result
if isinstance(offset, tuple):
- orig_number, orig_offset = offset
+ (orig_number, orig_offset) = offset
else:
for token_offset, token in self.mapping:
if offset >= token_offset: