From 79e1b068ee1a8e75b37ba4587b0ad1a192d2b0e5 Mon Sep 17 00:00:00 2001 From: ggpolar Date: Mon, 22 Jun 2020 17:05:43 +0800 Subject: [PATCH] Fix issue that the python source for an AST is wrong. The source code should be truncated after the start position, not a character from the start position. --- mindinsight/mindconverter/ast_edits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindinsight/mindconverter/ast_edits.py b/mindinsight/mindconverter/ast_edits.py index 36de6e7f..4e2e3e3e 100644 --- a/mindinsight/mindconverter/ast_edits.py +++ b/mindinsight/mindconverter/ast_edits.py @@ -297,7 +297,7 @@ class AstEditVisitor(ast.NodeVisitor): if source_prefix: pos = len(source_prefix) source_code = pasta.dump(node) - return source_code[pos] + return source_code[pos:] def _replace_external_reference(self): """