Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add script file's parent to sys.path before executing it (#724)

friedkeenan65d160f9aa45
diff --git a/manim/utils/module_ops.py b/manim/utils/module_ops.py
index 02a85673b..99faea529 100644
--- a/manim/utils/module_ops.py
+++ b/manim/utils/module_ops.py
@@ -36,6 +36,7 @@ def get_module(file_name):
spec = importlib.util.spec_from_file_location(module_name, file_name)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
+ sys.path.insert(0, str(file_name.parent.absolute()))
spec.loader.exec_module(module)
return module
else: