File tree Expand file tree Collapse file tree
custom_components/pyscript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1343,6 +1343,10 @@ async def ast_try(self, arg):
13431343 val = await self .aeval (arg1 )
13441344 if isinstance (val , EvalStopFlow ):
13451345 return val # pylint: disable=lost-exception,return-in-finally
1346+ self .exception = None
1347+ self .exception_obj = None
1348+ self .exception_long = None
1349+ self .exception_curr = None
13461350 return None
13471351
13481352 async def ast_raise (self , arg ):
Original file line number Diff line number Diff line change @@ -1907,6 +1907,26 @@ def func():
19071907""" ,
19081908 "Exception in test line 4 column 0: can only specify single decorator of pyscript_compile, pyscript_executor" ,
19091909 ],
1910+ [
1911+ """
1912+ try:
1913+ raise ValueError("Random error")
1914+ except KeyError:
1915+ pass
1916+ """ ,
1917+ "Exception in test line 3 column 21: Random error" ,
1918+ ],
1919+ [
1920+ """
1921+ try:
1922+ raise ValueError("Random error")
1923+ except ValueError as e:
1924+ pass
1925+
1926+ raise
1927+ """ ,
1928+ "Exception in test line 7 column 0: No active exception to reraise" ,
1929+ ],
19101930]
19111931
19121932
You can’t perform that action at this time.
0 commit comments