From 5ff8f3856b347935afb267fc84e4aaada3cd6d2c Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 23 May 2024 14:40:21 +0200 Subject: [PATCH] feat: streamline module imports in __main__.py Removed redundant imports of `deuthon.base` from `__main__.py`, cleaning up the module's import statements to enhance readability and maintainability. Also, annotated an `except` block with `noqa: F821` to suppress a specific linter warning related to the use of an undefined name. This change clarifies the intentional use of dynamic features and exceptions handling within the codebase, ensuring linting tools can accommodate our dynamic execution context without compromising code quality checks. This cleanup contributes to a leaner codebase, potentially improving load times and reducing memory footprint, aligning with our ongoing efforts to optimize the performance and clarity of the Deuthon project. --- src/deuthon/__main__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/deuthon/__main__.py b/src/deuthon/__main__.py index 5d8c20a..893ed2d 100755 --- a/src/deuthon/__main__.py +++ b/src/deuthon/__main__.py @@ -12,9 +12,6 @@ from deuthon.transformer import parse_german_code, prepare_builtin_overrides from deuthon.importer import install_deuthon_importer, import_base from deuthon.interpreter import interpreter -import deuthon.base - - def main(): args = ArgumentParser() args.add_argument("file", default="", nargs="?") @@ -41,7 +38,7 @@ def main(): try: exec(code_object, {"__file__": pathlib.Path(args.file).absolute()}) - except Ausnahme as e: + except Ausnahme as e: # noqa: F821 # Extract traceback information, excluding frames related to the interpreter tb = e.__traceback__ while tb is not None: