Fix test for Python <3.10 compat
tests / test (push) Successful in 5s

This commit is contained in:
TheRaiwy
2026-07-10 13:04:34 +03:00
parent 2266df40c6
commit 3dac157a4a
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
from __future__ import annotations
import io
import json
import logging
+3 -2
View File
@@ -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")