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):
782782 raise ModuleNotFoundError (f"module '{ imp .name } ' not found" )
783783 self .sym_table [imp .name if imp .asname is None else imp .asname ] = mod
784784 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
792791 if not mod :
793792 if not self .allow_all_imports and arg .module not in ALLOWED_IMPORTS :
794793 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):
6565 "log.info" : lambda ast_ctx : ast_ctx .get_logger ().info ,
6666 "log.warning" : lambda ast_ctx : ast_ctx .get_logger ().warning ,
6767 "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 ,
6969 }
7070 )
7171
You can’t perform that action at this time.
0 commit comments