@@ -1102,7 +1102,7 @@ def load_example(self, example_name):
11021102 """
11031103 try :
11041104 # Use importlib.resources to access packaged example files
1105- from importlib .resources import files
1105+ from importlib .resources import as_file , files
11061106
11071107 example_files = files ("petab_gui.example" )
11081108
@@ -1119,10 +1119,6 @@ def load_example(self, example_name):
11191119 # Get the problem.yaml file path for the specified example
11201120 yaml_file = example_files .joinpath (example_name , "problem.yaml" )
11211121
1122- # For importlib.resources, we need to handle this differently
1123- # in Python 3.9+ we can use as_file context manager
1124- from importlib .resources import as_file
1125-
11261122 with as_file (yaml_file ) as yaml_path :
11271123 if not yaml_path .exists ():
11281124 error_msg = f"Example '{ example_name } ' not found or problem.yaml file is missing."
@@ -1149,7 +1145,6 @@ def load_example(self, example_name):
11491145 except Exception as e :
11501146 error_msg = f"Failed to load example: { str (e )} "
11511147 self .logger .log_message (error_msg , color = "red" )
1152- logging .exception ("Full traceback for load example error:" )
11531148 QMessageBox .critical (self .view , "Error Loading Example" , error_msg )
11541149
11551150 def check_model (self ):
0 commit comments