mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
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.
This commit is contained in:
parent
008e81e025
commit
52149b7a2c
1 changed files with 2 additions and 5 deletions
|
@ -29,10 +29,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info.major >= 3:
|
from io import StringIO
|
||||||
from io import StringIO
|
|
||||||
else:
|
|
||||||
from io import BytesIO as StringIO
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -172,7 +169,7 @@ def main():
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
|
|
||||||
if not args.i:
|
if not args.i:
|
||||||
with open(filename) as f:
|
with open(filename, encoding="utf8") as f:
|
||||||
code = f.readlines()
|
code = f.readlines()
|
||||||
formatted_code = StringIO(stdout).readlines()
|
formatted_code = StringIO(stdout).readlines()
|
||||||
diff = difflib.unified_diff(
|
diff = difflib.unified_diff(
|
||||||
|
|
Loading…
Add table
Reference in a new issue