From 4ad0921cb4e75f0fab120c845d73990075da152d Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Sat, 3 Jan 2015 10:00:00 +0200 Subject: Use the new Module.stream, since Module.file_stream is deprecated. --- examples/custom_raw.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples') 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): -- cgit v1.2.1