From 0b22e50e1cca695c9dc578df0b4af4024b1b1377 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Thu, 8 Feb 2024 12:02:00 +0000 Subject: [PATCH] Remove try except around defusedxml as it is a dependency (#29) --- dissect/hypervisor/descriptor/pvs.py | 5 +---- dissect/hypervisor/descriptor/vbox.py | 5 +---- dissect/hypervisor/disk/hdd.py | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/dissect/hypervisor/descriptor/pvs.py b/dissect/hypervisor/descriptor/pvs.py index 23c4a40..75008c0 100644 --- a/dissect/hypervisor/descriptor/pvs.py +++ b/dissect/hypervisor/descriptor/pvs.py @@ -1,10 +1,7 @@ from typing import IO, Iterator from xml.etree.ElementTree import Element -try: - from defusedxml import ElementTree -except ImportError: - from xml.etree import ElementTree +from defusedxml import ElementTree class PVS: diff --git a/dissect/hypervisor/descriptor/vbox.py b/dissect/hypervisor/descriptor/vbox.py index 1dc1779..41cb03c 100644 --- a/dissect/hypervisor/descriptor/vbox.py +++ b/dissect/hypervisor/descriptor/vbox.py @@ -1,10 +1,7 @@ from typing import IO, Iterator from xml.etree.ElementTree import Element -try: - from defusedxml import ElementTree -except ImportError: - from xml.etree import ElementTree +from defusedxml import ElementTree class VBox: diff --git a/dissect/hypervisor/disk/hdd.py b/dissect/hypervisor/disk/hdd.py index efe9d1b..a451d4a 100644 --- a/dissect/hypervisor/disk/hdd.py +++ b/dissect/hypervisor/disk/hdd.py @@ -8,11 +8,7 @@ from uuid import UUID from xml.etree.ElementTree import Element -try: - from defusedxml import ElementTree -except ImportError: - from xml.etree import ElementTree - +from defusedxml import ElementTree from dissect.util.stream import AlignedStream from dissect.hypervisor.disk.c_hdd import SECTOR_SIZE, c_hdd