diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py index 84e6c60641..ef6f01b8fe 100644 --- a/common/lib/xmodule/xmodule/xml_module.py +++ b/common/lib/xmodule/xmodule/xml_module.py @@ -5,9 +5,7 @@ import copy import json import logging import os -import sys -import six from lxml import etree from lxml.etree import Element, ElementTree, XMLParser from xblock.core import XML_NAMESPACES @@ -213,9 +211,7 @@ class XmlParserMixin: return cls.file_to_xml(xml_file) except Exception as err: # lint-amnesty, pylint: disable=broad-except # Add info about where we are, but keep the traceback - msg = 'Unable to load file contents at path {} for item {}: {} '.format( - filepath, def_id, err) - six.reraise(Exception, msg, sys.exc_info()[2]) + raise Exception(f'Unable to load file contents at path {filepath} for item {def_id}: {err}') from err @classmethod def load_definition(cls, xml_object, system, def_id, id_generator):