diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-03 10:00:00 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-03 10:00:00 +0200 |
commit | 4ad0921cb4e75f0fab120c845d73990075da152d (patch) | |
tree | badab4ca72cf7d8cc6af18f38776dddffa1ae4da /examples | |
parent | 98f292601d5db900732842031db3b22366f799aa (diff) | |
download | pylint-4ad0921cb4e75f0fab120c845d73990075da152d.tar.gz |
Use the new Module.stream, since Module.file_stream is deprecated.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/custom_raw.py | 9 |
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): |