diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-24 10:03:34 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-24 10:03:34 +0200 |
commit | 5a6e387443b2d9463cf42019d141b6105bcde7a9 (patch) | |
tree | b1641fab500a4755f99412655d2fccb784f4e97f | |
parent | f653d47961629af715de253827862c406b7cb0a8 (diff) | |
download | astroid-git-fix-pylint-warning-from-master-branch.tar.gz |
Disable consider-using-with in function returning a streamfix-pylint-warning-from-master-branch
-rw-r--r-- | astroid/builder.py | 1 | ||||
-rw-r--r-- | astroid/scoped_nodes.py | 1 | ||||
-rw-r--r-- | pylintrc | 6 |
3 files changed, 7 insertions, 1 deletions
diff --git a/astroid/builder.py b/astroid/builder.py index 789c2c0a..de5acac1 100644 --- a/astroid/builder.py +++ b/astroid/builder.py @@ -50,6 +50,7 @@ MANAGER = manager.AstroidManager() def open_source_file(filename): + # pylint: disable=consider-using-with with open(filename, "rb") as byte_stream: encoding = detect_encoding(byte_stream.readline)[0] stream = open(filename, newline=None, encoding=encoding) diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index 9dff37a8..801b55ee 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -503,6 +503,7 @@ class Module(LocalsDictNodeNG): if self.file_bytes is not None: return io.BytesIO(self.file_bytes) if self.file is not None: + # pylint: disable=consider-using-with stream = open(self.file, "rb") return stream return None @@ -110,7 +110,11 @@ disable=fixme, format, # temporary until we fix the problems with InferenceContexts no-member, - # everything here is legacy not checked in astroid/brain + # We might want to disable new checkers from master that do not exists + # in latest published pylint + bad-option-value, + # Legacy warning not checked in astroid/brain before we + # transitioned to setuptools and added an init.py duplicate-code, enable=useless-suppression |