UFOReader: close underlying fs object if UFOLibError raised in constructor

This commit is contained in:
Cosimo Lupo 2020-05-06 19:11:39 +01:00
parent 57f4904363
commit c57e843d1f
No known key found for this signature in database
GPG Key ID: 179A8F0895A02F4F

View File

@ -267,9 +267,14 @@ class UFOReader(_UFOBaseIO):
)
self._path = fsdecode(path)
self._validate = validate
self.readMetaInfo(validate=validate)
self._upConvertedKerningData = None
try:
self.readMetaInfo(validate=validate)
except UFOLibError:
self.close()
raise
# properties
def _get_path(self):