File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -18,32 +18,32 @@ def example_folder() -> Path:
1818 def run_example_module (module_path : Path ):
1919 """
2020 Dynamically import and run an example module.
21-
21+
2222 Args:
2323 module_path: Path to the example Python file to run
2424 """
2525 # Add the module's directory to sys.path temporarily
2626 module_dir = str (module_path .parent )
2727 original_cwd = os .getcwd ()
2828 original_path = sys .path .copy ()
29-
29+
3030 try :
3131 # Change to the example directory
3232 os .chdir (module_dir )
3333 sys .path .insert (0 , module_dir )
34-
34+
3535 # Load the module
3636 spec = importlib .util .spec_from_file_location ("test_module" , module_path )
3737 if spec and spec .loader :
3838 module = importlib .util .module_from_spec (spec )
39-
39+
4040 # Execute the module
4141 spec .loader .exec_module (module )
42-
42+
4343 # If the module has a main function, call it
4444 if hasattr (module , "main" ):
4545 module .main ()
46-
46+
4747 finally :
4848 # Restore original directory and path
4949 os .chdir (original_cwd )
You can’t perform that action at this time.
0 commit comments