Skip to content

Commit 53a031d

Browse files
authored
Use binary file for devnull (#271)
Use binary file for devnull This is not a bug. But binary file is more efficient because TextIOWrapper is not used.
1 parent dc1fb8a commit 53a031d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

distro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ def _lsb_release_info(self):
11061106
"""
11071107
if not self.include_lsb:
11081108
return {}
1109-
with open(os.devnull, "w") as devnull:
1109+
with open(os.devnull, "wb") as devnull:
11101110
try:
11111111
cmd = ("lsb_release", "-a")
11121112
stdout = subprocess.check_output(cmd, stderr=devnull)
@@ -1144,7 +1144,7 @@ def _parse_lsb_release_content(lines):
11441144
@cached_property
11451145
def _uname_info(self):
11461146
# type: () -> Dict[str, str]
1147-
with open(os.devnull, "w") as devnull:
1147+
with open(os.devnull, "wb") as devnull:
11481148
try:
11491149
cmd = ("uname", "-rs")
11501150
stdout = subprocess.check_output(cmd, stderr=devnull)

0 commit comments

Comments
 (0)