summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/custom_raw.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/custom_raw.py b/examples/custom_raw.py
index 00fbe89..da576a2 100644
--- a/examples/custom_raw.py
+++ b/examples/custom_raw.py
@@ -18,11 +18,12 @@ class MyRawChecker(BaseChecker):
def process_module(self, node):
"""process a module
- the module's content is accessible via node.file_stream object
+ the module's content is accessible via node.stream() function
"""
- for (lineno, line) in enumerate(node.file_stream):
- if line.rstrip().endswith('\\'):
- self.add_message('W9901', line=lineno)
+ with module.stream() as stream:
+ for (lineno, line) in enumerate(stream):
+ if line.rstrip().endswith('\\'):
+ self.add_message('W9901', line=lineno)
def register(linter):