Skip to content

Commit

Permalink
add huge tree argument
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbuchwald committed Jun 24, 2024
1 parent c19290f commit c0463a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ogs6py/ogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, **args):
self.__dict2xml(self.root, self.linsolvers.tree))
self._add_includes(self.root)"""
# Reparsing for pretty_print to work properly
parse = ET.XMLParser(remove_blank_text=True)
parse = ET.XMLParser(remove_blank_text=True, huge_tree=True)
tree_string = ET.tostring(self.root, pretty_print=True)
tree_ = ET.fromstring(tree_string, parser=parse)
self.tree = ET.ElementTree(tree_)
Expand Down Expand Up @@ -147,7 +147,7 @@ def __replace_blocks_by_includes(self):
parent_element.remove(self.include_elements[i])

def _get_root(self, remove_blank_text=False, remove_comments=False):
parser = ET.XMLParser(remove_blank_text=remove_blank_text, remove_comments=remove_comments)
parser = ET.XMLParser(remove_blank_text=remove_blank_text, remove_comments=remove_comments, huge_tree=True)
if self.tree is None:
if self.inputfile is not None:
self.tree = ET.parse(self.inputfile, parser)
Expand Down

0 comments on commit c0463a4

Please sign in to comment.