linter: Assert that _run() is called with a buffer
This commit is contained in:
@@ -94,6 +94,9 @@ def get_syntax_error(buffer):
|
|||||||
|
|
||||||
|
|
||||||
def _run(buffer, conf):
|
def _run(buffer, conf):
|
||||||
|
assert hasattr(buffer, '__getitem__'), \
|
||||||
|
'_run() argument must be a buffer, not a stream'
|
||||||
|
|
||||||
# If the document contains a syntax error, save it and yield it at the
|
# If the document contains a syntax error, save it and yield it at the
|
||||||
# right line
|
# right line
|
||||||
syntax_error = get_syntax_error(buffer)
|
syntax_error = get_syntax_error(buffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user