@@ -1,3 +1,4 @@
|
||||
from __future__ import annotations
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
|
||||
+3
-2
@@ -13,8 +13,9 @@ for node in ast.walk(tree):
|
||||
func_def = node
|
||||
break
|
||||
|
||||
# exec only the function
|
||||
exec(compile(ast.Module([func_def], []), "<parse>", "exec"))
|
||||
# exec only the function (with from __future__ import annotations for <3.10 compat)
|
||||
func_src = "from __future__ import annotations\n" + ast.unparse(func_def)
|
||||
exec(compile(func_src, "<parse>", "exec"))
|
||||
|
||||
def test_login_pass():
|
||||
r = parse_account_line("user:pass")
|
||||
|
||||
Reference in New Issue
Block a user