Update Mako-1.1.5

This commit is contained in:
JonnyWong16 2021-10-14 21:46:34 -07:00
parent 4eb0fea423
commit 668f6bfbb8
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
5 changed files with 28 additions and 12 deletions

View file

@ -27,7 +27,15 @@ class LinguaMakoExtractor(Extractor, MessageExtractor):
self.python_extractor = get_extractor("x.py")
if fileobj is None:
fileobj = open(filename, "rb")
return self.process_file(fileobj)
must_close = True
else:
must_close = False
try:
for message in self.process_file(fileobj):
yield message
finally:
if must_close:
fileobj.close()
def process_python(self, code, code_lineno, translator_strings):
source = code.getvalue().strip()