diff --git a/src/py_to_uxf/application.py b/src/py_to_uxf/application.py index 135d07f..8c31326 100644 --- a/src/py_to_uxf/application.py +++ b/src/py_to_uxf/application.py @@ -1,3 +1,4 @@ +import sys import traceback from cpl_core.application import ApplicationABC @@ -23,7 +24,7 @@ class Application(ApplicationABC): self._file = config.get_configuration('-pAdditionalArguments')[1] except Exception as e: Console.error('Expected file') - exit() + sys.exit() self._parser: PythonParserABC = services.get_service(PythonParserABC) self._umlet_creator: UmletCreatorABC = services.get_service(UmletCreatorABC) @@ -68,11 +69,11 @@ class Application(ApplicationABC): xml = self._umlet_creator.generate_xml(classes, implementations) except Exception as e: Console.error('Parsing failed', f'{e} -> {traceback.format_exc()}') - exit() + sys.exit() if not self._file.endswith('.uxf'): Console.error(f'Unexpected file {self._file}') - exit() + sys.exit() with open(self._file, 'w+') as file: file.write(xml) diff --git a/src/py_to_uxf_core/service/python_parser_service.py b/src/py_to_uxf_core/service/python_parser_service.py index ea38cfc..9aef324 100644 --- a/src/py_to_uxf_core/service/python_parser_service.py +++ b/src/py_to_uxf_core/service/python_parser_service.py @@ -1,3 +1,4 @@ +import sys import traceback from typing import Optional @@ -96,7 +97,7 @@ class PythonParserService(PythonParserABC): except Exception as e: Console.error(f'Parsing {file}@{i}', f'{e} -> {traceback.format_exc()}') file_content.close() - exit() + sys.exit() file_content.close() return classes @@ -149,6 +150,6 @@ class PythonParserService(PythonParserABC): except Exception as e: Console.error(f'Parsing {file}@{i}', f'{e} -> {traceback.format_exc()}') file_content.close() - exit() + sys.exit() file_content.close() return implementations