summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-25 18:44:47 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-25 18:44:47 +0200
commit0b3f88c3efd475102669a12283ecf411d6d276ba (patch)
tree2f5be9c26b2b6f53a2f5886be6722879d625936f
parent9af934083b7e3fadcc6b06ee1d5856ea0ef967b2 (diff)
downloadpylint-0b3f88c3efd475102669a12283ecf411d6d276ba.tar.gz
Use the new Module.close to close the file streams.
-rw-r--r--lint.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/lint.py b/lint.py
index 6f762cc..ef57faa 100644
--- a/lint.py
+++ b/lint.py
@@ -862,14 +862,8 @@ class PyLinter(OptionsManagerMixIn, MessagesHandlerMixIn, ReportsHandlerMixIn,
return self._check_astroid_module(astroid, walker,
rawcheckers, tokencheckers)
finally:
- # Close file_stream, if opened, to avoid to open many files.
- if astroid.file_stream:
- astroid.file_stream.close()
- # TODO(cpopa): This is an implementation detail, but it will
- # be moved in astroid at some point.
- # We invalidate the cached property, to let the others
- # modules which relies on this one to get a new file stream.
- del astroid.file_stream
+ # Close the streams opened by the ast module.
+ astroid.close()
def _check_astroid_module(self, astroid, walker, rawcheckers, tokencheckers):
# call raw checkers if possible