From 0b3f88c3efd475102669a12283ecf411d6d276ba Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 25 Nov 2014 18:44:47 +0200 Subject: Use the new Module.close to close the file streams. --- lint.py | 10 ++-------- 1 file 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 -- cgit v1.2.1