support/scripts: fix pycompile for short filenames

Signed-off-by: Bert Outtier <outtierbert@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 6fdc878d73)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Bert Outtier 2021-03-29 12:55:54 +02:00 committed by Peter Korsgaard
parent 66e6177ea9
commit ea9fdc21ef

View File

@ -28,7 +28,7 @@ def compile_one(host_path, strip_root=None):
if os.path.islink(host_path) or not os.path.isfile(host_path):
return # only compile real files
if not re.match(r"^[_A-Za-z][_A-Za-z0-9]+\.py$",
if not re.match(r"^[_A-Za-z][_A-Za-z0-9]*\.py$",
os.path.basename(host_path)):
return # only compile "importable" python modules