From 602140792915d46d2ae23b79b06a961cb9aa8585 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 14 Oct 2018 12:01:15 +0200 Subject: [PATCH] Revert "Optimize code" This reverts commit c5e1d7a7df34d71cd35f66e92f2c43d3185d367c. --- resources/lib/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index cea9a207..459a2b72 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -678,7 +678,7 @@ class XmlKodiSetting(object): if self.force_create is False: LOG.debug('%s does not seem to exist; not creating', self.path) # This will abort __enter__ - raise IOError + self.__exit__(IOError, None, None) # Create topmost xml entry self.tree = etree.ElementTree( element=etree.Element(self.top_element)) @@ -690,7 +690,7 @@ class XmlKodiSetting(object): messageDialog(lang(29999), lang(39716).format( self.filename, 'http://kodi.wiki')) - raise etree.ParseError + self.__exit__(etree.ParseError, None, None) self.root = self.tree.getroot() return self