Description: Handle Python >=3.8 Constant AST nodes in the rebuilder
 In Python 3.8+ the ast module represents every literal constant with a
 unified ast.Constant node (formerly ast.Str / ast.Num / ast.Bytes /
 ast.NameConstant). astroid 1.6.5 predates this and only provides
 visit_const, so rebuilding any module that contains a literal raises
 'AttributeError: TreeRebuilder3 object has no attribute visit_constant'
 during the test build. Map the Constant node to the existing visit_const
 method via the REDIRECT dispatch table.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: no
Last-Update: 2026-08-27

--- astroid2-for-python3-1.6.5.orig/astroid/rebuilder.py
+++ astroid2-for-python3-1.6.5/astroid/rebuilder.py
@@ -36,6 +36,7 @@ REDIRECT = {'arguments': 'Arguments',
             'comprehension': 'Comprehension',
             "ListCompFor": 'Comprehension',
             "GenExprFor": 'Comprehension',
+            'Constant': 'Const',
             'excepthandler': 'ExceptHandler',
             'keyword': 'Keyword',
            }
