From 06c06c6a7e3bdafc86649fec9ad65517fa52243b Mon Sep 17 00:00:00 2001 From: Vitaly Budovski Date: Tue, 19 Aug 2025 09:51:27 +0900 Subject: [PATCH] fix: Use correct property of ast.Constant The private property 's' has been deprecated since 3.8, and removed in 3.14. https://github.com/python/cpython/issues/119562 --- src/allianceutils/checks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/allianceutils/checks.py b/src/allianceutils/checks.py index 455e8af..381d83d 100644 --- a/src/allianceutils/checks.py +++ b/src/allianceutils/checks.py @@ -284,7 +284,7 @@ def _check_explicit_table_names_on_model(model: Type[Model], enforce_lowercase: first_target = sub_node.targets[0] if first_target.id == 'db_table': # type:ignore[attr-defined] # isn't present in type defs if isinstance(sub_node.value, ast.Constant): - found = sub_node.value.s + found = sub_node.value.value else: # If it's an expression then we don't know what it's going to evaluate it # so we're just going to assume it's ok @@ -295,7 +295,7 @@ def _check_explicit_table_names_on_model(model: Type[Model], enforce_lowercase: elif ( first_target.id == 'managed' # type:ignore[attr-defined] # isn't present in type defs and isinstance(sub_node.value, (ast.Constant)) - and sub_node.value.s == False + and sub_node.value.value == False ): found = True break