Skip to content

Commit 673aca0

Browse files
committed
Prefer 'encoding' over 'text=True'
1 parent 0986b77 commit 673aca0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tools/build/smelly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_exported_symbols(library, dynamic=False):
5252
args.append('--dynamic')
5353
args.append(library)
5454
print(f"+ {' '.join(args)}")
55-
proc = subprocess.run(args, stdout=subprocess.PIPE, text=True)
55+
proc = subprocess.run(args, stdout=subprocess.PIPE, encoding='utf-8')
5656
if proc.returncode:
5757
sys.stdout.write(proc.stdout)
5858
sys.exit(proc.returncode)

Tools/build/stable_abi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def binutils_get_exported_symbols(library, dynamic=False):
475475
if dynamic:
476476
args.append("--dynamic")
477477
args.append(library)
478-
proc = subprocess.run(args, stdout=subprocess.PIPE, text=True)
478+
proc = subprocess.run(args, stdout=subprocess.PIPE, encoding='utf-8')
479479
if proc.returncode:
480480
sys.stdout.write(proc.stdout)
481481
sys.exit(proc.returncode)
@@ -545,7 +545,7 @@ def gcc_get_limited_api_macros(headers):
545545
"-E",
546546
]
547547
+ [str(file) for file in headers],
548-
text=True,
548+
encoding='utf-8',
549549
)
550550

551551
return set(re.findall(r"#define (\w+)", preprocessor_output_with_macros))
@@ -583,7 +583,7 @@ def gcc_get_limited_api_definitions(headers):
583583
"-E",
584584
]
585585
+ [str(file) for file in headers],
586-
text=True,
586+
encoding='utf-8',
587587
stderr=subprocess.DEVNULL,
588588
)
589589
stable_functions = set(

0 commit comments

Comments
 (0)