File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
custom_components/pyscript Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 55import builtins
66import importlib
77import inspect
8+ import keyword
89import logging
910import sys
1011
@@ -220,8 +221,8 @@ async def eval_decorators(self, ast_ctx):
220221 kwargs = {}
221222 for arg in dec .args :
222223 args .append (await ast_ctx .aeval (arg ))
223- for keyword in dec .keywords :
224- kwargs [keyword .arg ] = await ast_ctx .aeval (keyword .value )
224+ for keyw in dec .keyw :
225+ kwargs [keyw .arg ] = await ast_ctx .aeval (keyw .value )
225226 if len (kwargs ) == 0 :
226227 kwargs = None
227228 self .decorators .append ([dec .func .id , args , kwargs ])
@@ -1325,6 +1326,9 @@ def completions(self, root):
13251326 words .add (f"{ name } .{ attr } " )
13261327 except Exception : # pylint: disable=broad-except
13271328 pass
1329+ for keyw in set (keyword .kwlist ) - {"yield" , "lambda" , "with" , "assert" }:
1330+ if keyw .lower ().startswith (root ):
1331+ words .add (keyw )
13281332 sym_table = BUILTIN_AST_FUNCS_FACTORY .copy ()
13291333 for name , value in builtins .__dict__ .items ():
13301334 if name [0 ] != "_" and name not in BUILTIN_EXCLUDE :
You can’t perform that action at this time.
0 commit comments