diff --git a/javacore_set.py b/javacore_set.py index c5eff1d..2f40fb3 100644 --- a/javacore_set.py +++ b/javacore_set.py @@ -447,10 +447,12 @@ def get_javacore_set_in_xml(self): Returns: str: The JavaCore set in the XML format. """ - file = open(self.report_xml_file, "r") - content = file.read() - file.close() - return content + try: + file = open(self.report_xml_file, "r") + content = file.read() + return content + finally: + file.close() @staticmethod def __create_index_html(input_dir, output_dir):