diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2011-10-26 09:35:41 +0200 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2011-10-26 09:35:41 +0200 |
commit | d3f545682f301e4b388bb9677ecab1ce51b2668c (patch) | |
tree | b9b43f2517699e59f4df5b1df8fe44e824cc417a | |
parent | a91af2c9b5dfdca8f077fb3f535e94014e8cf999 (diff) | |
download | pylint-git-d3f545682f301e4b388bb9677ecab1ce51b2668c.tar.gz |
add note about soon useless stream.seek()
-rw-r--r-- | checkers/__init__.py | 2 | ||||
-rw-r--r-- | checkers/format.py | 2 | ||||
-rw-r--r-- | checkers/misc.py | 2 | ||||
-rw-r--r-- | checkers/similar.py | 2 | ||||
-rw-r--r-- | examples/custom_raw.py | 4 |
5 files changed, 5 insertions, 7 deletions
diff --git a/checkers/__init__.py b/checkers/__init__.py index d33cacf34..969066b5b 100644 --- a/checkers/__init__.py +++ b/checkers/__init__.py @@ -120,7 +120,7 @@ class BaseRawChecker(BaseChecker): stream must implement the readline method """ stream = node.file_stream - stream.seek(0) + stream.seek(0) # XXX may be removed with astng > 0.23 self.process_tokens(tokenize.generate_tokens(stream.readline)) def process_tokens(self, tokens): diff --git a/checkers/format.py b/checkers/format.py index 6a2d5aca0..0784e6af7 100644 --- a/checkers/format.py +++ b/checkers/format.py @@ -183,7 +183,7 @@ class FormatChecker(BaseRawChecker): international text's length is properly calculated. """ stream = node.file_stream - stream.seek(0) + stream.seek(0) # XXX may be removed with astng > 0.23 readline = stream.readline if sys.version_info < (3, 0): if node.file_encoding is not None: diff --git a/checkers/misc.py b/checkers/misc.py index 8f6ad2dc0..7f09d404d 100644 --- a/checkers/misc.py +++ b/checkers/misc.py @@ -55,7 +55,7 @@ separated by a comma.' notes """ stream = node.file_stream - stream.seek(0) + stream.seek(0) # XXX may be removed with astng > 0.23 # warning notes in the code notes = [] for note in self.config.notes: diff --git a/checkers/similar.py b/checkers/similar.py index a647adaeb..1e38ed61e 100644 --- a/checkers/similar.py +++ b/checkers/similar.py @@ -39,7 +39,7 @@ class Similar: def append_stream(self, streamid, stream): """append a file to search for similarities""" - stream.seek(0) + stream.seek(0) # XXX may be removed with astng > 0.23 self.linesets.append(LineSet(streamid, stream.readlines(), self.ignore_comments, diff --git a/examples/custom_raw.py b/examples/custom_raw.py index 811c78502..00fbe89d1 100644 --- a/examples/custom_raw.py +++ b/examples/custom_raw.py @@ -20,9 +20,7 @@ class MyRawChecker(BaseChecker): the module's content is accessible via node.file_stream object """ - stream = node.file_stream - stream.seek(0) - for (lineno, line) in enumerate(stream): + for (lineno, line) in enumerate(node.file_stream): if line.rstrip().endswith('\\'): self.add_message('W9901', line=lineno) |