mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 09:53:47 +01: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
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user