summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
Diffstat (limited to 'astroid')
-rw-r--r--astroid/builder.py1
-rw-r--r--astroid/scoped_nodes.py1
2 files changed, 2 insertions, 0 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