a4d630823083 draft — Oben Sonne tip 1 year, 24 days ago
Remove minor redundancies in macros importing
1 files changed, 4 insertions(+), 5 deletions(-)

M poole.py
M poole.py +4 -5
@@ 520,13 520,12 @@ def build(project, opts):
 
     # macro module
     fname = opj(opts.project, "macros.py")
-    if os.path.exists(fname):
-        module_name, fname = "macros", opj(opts.project, "macros.py")
-        spec = importlib.util.spec_from_file_location(module_name, fname)
+    if opx(fname):
+        spec = importlib.util.spec_from_file_location("macros", fname)
         module = importlib.util.module_from_spec(spec)
-        sys.modules[module_name] = module
+        sys.modules["macros"] = module
         spec.loader.exec_module(module)
-        macros = module.__dict__ if opx(fname) else {}
+        macros = module.__dict__
     else:
         macros = {}