diff --git a/src/deuthon/__main__.py b/src/deuthon/__main__.py index fefd73d..a7491cf 100755 --- a/src/deuthon/__main__.py +++ b/src/deuthon/__main__.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 -import ast -import tokenize import pathlib import sys import traceback @@ -25,7 +23,6 @@ def main(): if args.file: script_path = pathlib.Path(args.file).absolute() - script_dir = script_path.parent # Read and transpile the German code with open(script_path) as f: diff --git a/src/deuthon/importer.py b/src/deuthon/importer.py index b179247..c215daa 100644 --- a/src/deuthon/importer.py +++ b/src/deuthon/importer.py @@ -32,7 +32,6 @@ class DeuthonSourceLoader(importlib.machinery.SourceFileLoader): def source_to_code(self, data, path, *, _optimize=-1): reader = tokenize.open(path) try: - encoding = reader.encoding source_data = reader.read() finally: reader.close() @@ -122,12 +121,6 @@ class DeuthonModuleFinder(importlib.abc.MetaPathFinder): if deuthon_path: path.extend(deuthon_path.split(os.pathsep)) - # The base name for the file we're trying to find will be the last component of 'fullname' - # e.g., for 'testmodul.submodul.test', we want to end up with 'test.deu' - module_basename = ( - fullname.rpartition(".")[-1] + self.extension - ) # e.g., 'test.deu' - for entry in path: module_full_path = os.path.join( entry, fullname.replace(".", "/") + self.extension diff --git a/src/deuthon/transformer.py b/src/deuthon/transformer.py index 72404e4..f52fa7e 100644 --- a/src/deuthon/transformer.py +++ b/src/deuthon/transformer.py @@ -1,4 +1,3 @@ -import ast import tokenize from io import BytesIO