sp_fr: pass only file descriptors to ET.parse() (#52876)

This commit is contained in:
Benjamin Dauvergne 2021-04-08 17:35:44 +02:00
parent fbac97e92e
commit 0f21ea0645
1 changed files with 3 additions and 1 deletions

View File

@ -551,7 +551,9 @@ class Mapping(models.Model):
@property
def xsd(self):
doc = ET.parse(os.path.join(os.path.dirname(__file__), '%s.XSD' % self.procedure))
path = os.path.join(os.path.dirname(__file__), '%s.XSD' % self.procedure)
with open(path, 'rb') as fd:
doc = ET.parse(fd)
schema = Schema()
schema.visit(doc.getroot())
return schema