diff options
author | TheCharlatan <seb.kung@gmail.com> | 2024-01-17 11:08:11 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2024-01-17 11:10:15 +0100 |
commit | 52149b7a2c2b48ed4a4c0900c74cda4bb52a1ea5 (patch) | |
tree | 84dd429aef1b3c50a26afdbf3000727101f77dfa | |
parent | 008e81e025d64c33e1e71b5a2fe63dfdf6b31437 (diff) | |
download | bitcoin-52149b7a2c2b48ed4a4c0900c74cda4bb52a1ea5.tar.xz |
contrib: Fix clang-format-diff.py lint errors
We assume to be using python3, so don't check for it. This removes a
type error on the line `from io import BytesIO as StringIO`.
Specify the encoding as "utf8" when opening a file.
-rwxr-xr-x | contrib/devtools/clang-format-diff.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/contrib/devtools/clang-format-diff.py b/contrib/devtools/clang-format-diff.py index 0a2c247436..e2b661d65d 100755 --- a/contrib/devtools/clang-format-diff.py +++ b/contrib/devtools/clang-format-diff.py @@ -29,10 +29,7 @@ import re import subprocess import sys -if sys.version_info.major >= 3: - from io import StringIO -else: - from io import BytesIO as StringIO +from io import StringIO def main(): @@ -172,7 +169,7 @@ def main(): sys.exit(p.returncode) if not args.i: - with open(filename) as f: + with open(filename, encoding="utf8") as f: code = f.readlines() formatted_code = StringIO(stdout).readlines() diff = difflib.unified_diff( |