lib: Replace codegen with ast.unparse()
PATCH 1/1 lib: Replace codegen with ast.unparse()
Since python 3.9, ast can generate code from an ast. We can therefore drop codegen.py and use python's internal functionality for this.
[YOCTO #16229]
Signed-off-by Richard Purdie <[email protected]>
--- lib/bb/codeparser.py | 5 +- lib/codegen.py | 564 ------------------------------------------- 2 files changed, 2 insertions(+), 567 deletions(-) delete mode 100644 lib/codegen.py
lib/bb/codeparser.py +2 -3
@@ -25,7 +25,6 @@ recipe caches don't trigger "Taskhash mismatch" errors. import ast import sys -import codegen import logging import inspect import bb.pysh as pysh
@@ -263,8 +262,8 @@ class PythonParser(): """ try: - funcstr = codegen.to_source(func) - argstr = codegen.to_source(arg) + funcstr = ast.unparse(func) + argstr = ast.unparse(arg) except TypeError: self.log.debug2('Failed to convert function and argument to source form') else:
lib/codegen.py deleted +0 -564
564 lines not on this page · raw message