diff --git a/main.py b/main.py index d26c313..a7cf6c3 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ +from __future__ import annotations import io import json import logging diff --git a/tests/test_parse.py b/tests/test_parse.py index 5763595..f316ca2 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -13,8 +13,9 @@ for node in ast.walk(tree): func_def = node break -# exec only the function -exec(compile(ast.Module([func_def], []), "", "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, "", "exec")) def test_login_pass(): r = parse_account_line("user:pass")