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