Skip to content

Commit

Permalink
import ParseError from defusedxml instead of xml
Browse files Browse the repository at this point in the history
 (#12)
  • Loading branch information
wolearyc authored Aug 31, 2024
1 parent 70da2c8 commit 991ec6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ramannoodle/io/vasp/vasprun.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TextIO
from pathlib import Path
from xml.etree.ElementTree import Element, ParseError
from xml.etree.ElementTree import Element
import defusedxml.ElementTree as ET

import numpy as np
Expand All @@ -21,7 +21,7 @@ def _get_root_element(file: TextIO) -> Element:
root = ET.parse(file).getroot()
assert isinstance(root, Element)
return root
except ParseError as exc:
except ET.ParseError as exc:
raise InvalidFileException("root xml element could not be found") from exc


Expand Down

0 comments on commit 991ec6b

Please sign in to comment.