File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
custom_components/pyscript Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -782,13 +782,12 @@ async def ast_importfrom(self, arg):
782
782
raise ModuleNotFoundError (f"module '{ imp .name } ' not found" )
783
783
self .sym_table [imp .name if imp .asname is None else imp .asname ] = mod
784
784
return
785
- else :
786
- mod , error_ctx = await self .global_ctx .module_import (arg .module , arg .level )
787
- if error_ctx :
788
- self .exception_obj = error_ctx .exception_obj
789
- self .exception = error_ctx .exception
790
- self .exception_long = error_ctx .exception_long
791
- raise self .exception_obj
785
+ mod , error_ctx = await self .global_ctx .module_import (arg .module , arg .level )
786
+ if error_ctx :
787
+ self .exception_obj = error_ctx .exception_obj
788
+ self .exception = error_ctx .exception
789
+ self .exception_long = error_ctx .exception_long
790
+ raise self .exception_obj
792
791
if not mod :
793
792
if not self .allow_all_imports and arg .module not in ALLOWED_IMPORTS :
794
793
raise ModuleNotFoundError (f"import from { arg .module } not allowed" )
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def init(cls, hass):
65
65
"log.info" : lambda ast_ctx : ast_ctx .get_logger ().info ,
66
66
"log.warning" : lambda ast_ctx : ast_ctx .get_logger ().warning ,
67
67
"print" : lambda ast_ctx : ast_ctx .get_logger ().debug ,
68
- "task.unique" : lambda ast_ctx : cls .task_unique_factory ( ast_ctx ) ,
68
+ "task.unique" : cls .task_unique_factory ,
69
69
}
70
70
)
71
71
You can’t perform that action at this time.
0 commit comments