Skip to content

Commit

Permalink
Fix tests for libexpat >=2.6.0 (or with CVE-2023-52425 fixes backport…
Browse files Browse the repository at this point in the history
…ed) (cea-hpc#556)

* tests/TreeGatewayTest.py: Close the XML parser when done

* tests/TreeGatewayTest.py: Call flush for Expat >=2.6.0
  • Loading branch information
hartwork authored Sep 9, 2024
1 parent e58d8bc commit e49f842
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/TreeGatewayTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ def _recvxml(self):
while not self.xml_reader.msg_available():
xml_msg = self.gateway.recv()
if len(xml_msg) == 0:
return None
self.parser.close()
break
self.assertTrue(type(xml_msg) is bytes)
self.parser.feed(xml_msg)
if hasattr(self.parser, 'flush'): # >=3.13 and backports
self.parser.flush()

return self.xml_reader.pop_msg()

Expand Down

0 comments on commit e49f842

Please sign in to comment.