Update pype/lib.py

precompile regex

Co-Authored-By: Ondřej Samohel <33513211+antirotor@users.noreply.github.com>
This commit is contained in:
Jakub Trllo 2020-04-03 09:53:25 +02:00 committed by GitHub
parent 7d48a0322d
commit fe5733771a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1205,8 +1205,9 @@ def get_last_workfile_path(root, template, file_ext):
version = None
last_file_name = None
re_template = re.compile(template)
for file_name in sorted(filtered_file_names):
match = re.match(template, file_name, **kwargs)
match = re.match(re_template, file_name, **kwargs)
if not match:
continue