Skip to content

Commit 0e406c1

Browse files
authored
Replace codecs.open with open (#10385)
1 parent a0c180d commit 0e406c1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pylint/graph.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from __future__ import annotations
1111

12-
import codecs
1312
import os
1413
import shutil
1514
import subprocess
@@ -103,7 +102,7 @@ def generate(
103102
os.close(pdot)
104103
else:
105104
dot_sourcepath = outputfile
106-
with codecs.open(dot_sourcepath, "w", encoding="utf8") as file:
105+
with open(dot_sourcepath, "w", encoding="utf8") as file:
107106
file.write(self.source)
108107
if target not in graphviz_extensions:
109108
if shutil.which(self.renderer) is None:

tests/pyreverse/test_writer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from __future__ import annotations
88

9-
import codecs
109
import os
1110
from collections.abc import Iterator, Sequence
1211
from difflib import unified_diff
@@ -65,7 +64,7 @@ def __init__(self) -> None:
6564

6665
def _file_lines(path: str) -> list[str]:
6766
# we don't care about the actual encoding, but python3 forces us to pick one
68-
with codecs.open(path, encoding="latin1") as stream:
67+
with open(path, encoding="latin1") as stream:
6968
lines = [
7069
line.strip()
7170
for line in stream.readlines()

0 commit comments

Comments
 (0)