mirror of
https://gitlab.com/kernel-firmware/linux-firmware.git
synced 2026-01-27 19:17:22 +01:00
check_whence: python3/utf-8 support
WHENCE contains non-ASCII characters, so we should specify an encoding. To get the encoding= arg in python2, we pull open from 'io' directly. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Josh Boyer <jwboyer@kernel.org>
This commit is contained in:
parent
7fa32bcc68
commit
94cb0a6837
1 changed files with 2 additions and 1 deletions
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import os, re, sys
|
||||
from io import open
|
||||
|
||||
def list_whence():
|
||||
with open('WHENCE') as whence:
|
||||
with open('WHENCE', encoding='utf-8') as whence:
|
||||
for line in whence:
|
||||
match = re.match(r'(?:File|Source):\s*"(.*)"', line)
|
||||
if match:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue