Skip to content

Commit e49f842

Browse files
authored
Fix tests for libexpat >=2.6.0 (or with CVE-2023-52425 fixes backported) (cea-hpc#556)
* tests/TreeGatewayTest.py: Close the XML parser when done * tests/TreeGatewayTest.py: Call flush for Expat >=2.6.0
1 parent e58d8bc commit e49f842

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/TreeGatewayTest.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,12 @@ def _recvxml(self):
131131
while not self.xml_reader.msg_available():
132132
xml_msg = self.gateway.recv()
133133
if len(xml_msg) == 0:
134-
return None
134+
self.parser.close()
135+
break
135136
self.assertTrue(type(xml_msg) is bytes)
136137
self.parser.feed(xml_msg)
138+
if hasattr(self.parser, 'flush'): # >=3.13 and backports
139+
self.parser.flush()
137140

138141
return self.xml_reader.pop_msg()
139142

0 commit comments

Comments
 (0)