From 3dac157a4a1a5ff8723527596e4cac9771c5f0b8 Mon Sep 17 00:00:00 2001 From: TheRaiwy Date: Fri, 10 Jul 2026 13:04:34 +0300 Subject: [PATCH] Fix test for Python <3.10 compat --- main.py | 1 + tests/test_parse.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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")