summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 76588c345f..5cef3fdadc 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -702,6 +702,8 @@ static string
new_type_comment(const char *s, struct compiling *c)
{
PyObject *res = PyUnicode_DecodeUTF8(s, strlen(s), NULL);
+ if (res == NULL)
+ return NULL;
if (PyArena_AddPyObject(c->c_arena, res) < 0) {
Py_DECREF(res);
return NULL;