mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-28 01:23:09 +00:00
Always use UTF-8 to open files in list_sources.py.
This avoids problems with some locale settings. Signed-off-by: Eduardo Sánchez Muñoz <eduardosanchezmunoz@gmail.com> (github: eduardosm)
This commit is contained in:
parent
8b54910538
commit
2eff766e88
@ -23,6 +23,7 @@ import sys
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
import codecs
|
||||
|
||||
def eprint(*args, **kwargs):
|
||||
print(*args, file=sys.stderr, **kwargs)
|
||||
@ -32,7 +33,7 @@ def check_non_empty_moc(file_path):
|
||||
if not os.path.isfile(file_path):
|
||||
return False
|
||||
if re.search(r'\.h$', file_path):
|
||||
with open(file_path, "r") as f:
|
||||
with codecs.open(file_path, mode="r", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
if re.search(r'(^|\s)Q_OBJECT(\s|$)', line):
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user