зеркало из https://github.com/electron/electron.git
build: fix python warnings "SyntaxWarning: invalid escape sequence '\w'" (#44650)
* fix: SyntaxWarning: invalid escape sequence '\w' * chore: remove some unused imports * fix: E711 warning 'Comparison to should be '
This commit is contained in:
Родитель
41b5d7e312
Коммит
8a67e77f03
|
@ -2,7 +2,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
DEFINE_EXTRACT_REGEX = re.compile('^ *# *define (\w*)', re.MULTILINE)
|
DEFINE_EXTRACT_REGEX = re.compile(r'^ *# *define (\w*)', re.MULTILINE)
|
||||||
|
|
||||||
def main(out_dir, headers):
|
def main(out_dir, headers):
|
||||||
defines = []
|
defines = []
|
||||||
|
|
|
@ -6,7 +6,6 @@ import pprint
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from lib.config import get_target_arch
|
|
||||||
|
|
||||||
ELECTRON_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
|
ELECTRON_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
|
||||||
NODE_DIR = os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node')
|
NODE_DIR = os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node')
|
||||||
|
@ -40,8 +39,8 @@ def read_electron_args():
|
||||||
for line in file_in:
|
for line in file_in:
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
continue
|
continue
|
||||||
m = re.match('(\w+) = (.+)', line)
|
m = re.match(r'(\w+) = (.+)', line)
|
||||||
if m == None:
|
if m is None:
|
||||||
continue
|
continue
|
||||||
args[m.group(1)] = m.group(2)
|
args[m.group(1)] = m.group(2)
|
||||||
return args
|
return args
|
||||||
|
|
|
@ -5,7 +5,7 @@ import glob
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from lib.config import PLATFORM, get_target_arch
|
from lib.config import PLATFORM
|
||||||
from lib.util import scoped_cwd, get_electron_version, make_zip, \
|
from lib.util import scoped_cwd, get_electron_version, make_zip, \
|
||||||
get_electron_branding, get_out_dir, execute
|
get_electron_branding, get_out_dir, execute
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче