summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-01-03 10:00:00 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-01-03 10:00:00 +0200
commitf47058b35554a36e733084c3417a3267cb7a1211 (patch)
tree08c3cf696b4200641db411dd83b90b1f571cd00e /examples
parentebd9d5a29c238e77481f33f4f4305346c5fe7080 (diff)
downloadpylint-git-f47058b35554a36e733084c3417a3267cb7a1211.tar.gz
Use the new Module.stream, since Module.file_stream is deprecated.
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 00fbe89d1..da576a293 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):