aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/future.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-04-18 12:39:32 +0300
committershadchin <shadchin@yandex-team.ru>2022-04-18 12:39:32 +0300
commitd4be68e361f4258cf0848fc70018dfe37a2acc24 (patch)
tree153e294cd97ac8b5d7a989612704a0c1f58e8ad4 /contrib/tools/python3/src/Python/future.c
parent260c02f5ccf242d9d9b8a873afaf6588c00237d6 (diff)
downloadydb-d4be68e361f4258cf0848fc70018dfe37a2acc24.tar.gz
IGNIETFERRO-1816 Update Python 3 from 3.9.12 to 3.10.4
ref:9f96be6d02ee8044fdd6f124b799b270c20ce641
Diffstat (limited to 'contrib/tools/python3/src/Python/future.c')
-rw-r--r--contrib/tools/python3/src/Python/future.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/contrib/tools/python3/src/Python/future.c b/contrib/tools/python3/src/Python/future.c
index 1663a38a6fd..d465608ca45 100644
--- a/contrib/tools/python3/src/Python/future.c
+++ b/contrib/tools/python3/src/Python/future.c
@@ -1,11 +1,5 @@
#include "Python.h"
-#include "Python-ast.h"
-#include "node.h"
-#include "token.h"
-#include "graminit.h"
-#include "code.h"
-#include "symtable.h"
-#include "ast.h"
+#include "pycore_ast.h" // _PyAST_GetDocString()
#define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined"
#define ERR_LATE_FUTURE \
@@ -15,11 +9,10 @@ static int
future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
{
int i;
- asdl_seq *names;
assert(s->kind == ImportFrom_kind);
- names = s->v.ImportFrom.names;
+ asdl_alias_seq *names = s->v.ImportFrom.names;
for (i = 0; i < asdl_seq_LEN(names); i++) {
alias_ty name = (alias_ty)asdl_seq_GET(names, i);
const char *feature = PyUnicode_AsUTF8(name->name);
@@ -123,7 +116,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
PyFutureFeatures *
-PyFuture_FromASTObject(mod_ty mod, PyObject *filename)
+_PyFuture_FromAST(mod_ty mod, PyObject *filename)
{
PyFutureFeatures *ff;
@@ -141,18 +134,3 @@ PyFuture_FromASTObject(mod_ty mod, PyObject *filename)
}
return ff;
}
-
-
-PyFutureFeatures *
-PyFuture_FromAST(mod_ty mod, const char *filename_str)
-{
- PyFutureFeatures *ff;
- PyObject *filename;
-
- filename = PyUnicode_DecodeFSDefault(filename_str);
- if (filename == NULL)
- return NULL;
- ff = PyFuture_FromASTObject(mod, filename);
- Py_DECREF(filename);
- return ff;
-}