mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 05:52:34 +08:00
Don't write new file when inserting embed line
Instead, load the relevant module of the true file, and execute the modified code within that. This also cleans up some of the previous now-unnecessary code around get_module_with_inserted_embed_line
This commit is contained in:
@ -76,10 +76,7 @@ class ModuleLoader:
|
||||
builtins.__import__ = tracked_import
|
||||
|
||||
try:
|
||||
# Remove the "_insert_embed" suffix from the module name
|
||||
module_name = module.__name__
|
||||
if module.__name__.endswith("_insert_embed"):
|
||||
module_name = module_name[:-13]
|
||||
log.debug('Reloading module "%s"', module_name)
|
||||
|
||||
spec.loader.exec_module(module)
|
||||
|
Reference in New Issue
Block a user