diff --git a/py/Boinc/boincxml.py b/py/Boinc/boincxml.py index ef9729c919..b5282eb529 100644 --- a/py/Boinc/boincxml.py +++ b/py/Boinc/boincxml.py @@ -122,15 +122,15 @@ class XMLConfig: """Read the XML object's file source and return self.""" if failopen_ok and not os.path.exists(self.filename): self._init_empty_xml() - return self - try: - self.xml = xml.dom.minidom.parse(self.filename) - strip_white_space(self.xml) - except: - if not failopen_ok: - raise Exception("Couldn't parse XML config\n") - print >>sys.stderr, "Warning: couldn't parse XML file" - self._init_empty_xml() + else: + try: + self.xml = xml.dom.minidom.parse(self.filename) + strip_white_space(self.xml) + except: + if not failopen_ok: + raise Exception("Couldn't parse XML config\n") + print >>sys.stderr, "Warning: couldn't parse XML file" + self._init_empty_xml() try: self._get_elements() except: