Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

[2.7] Properly fix PyBytes_AS_STRING being called on unicode objects #39

Merged
merged 1 commit into from
Apr 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ast27/Python/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
switch (e->kind) {
case Attribute_kind:
if (ctx == Store && !forbidden_check(c, n,
(char *)PyUnicode_AsUTF8String(e->v.Attribute.attr)))
PyUnicode_AsUTF8(e->v.Attribute.attr)))
return 0;
e->v.Attribute.ctx = ctx;
break;
Expand All @@ -465,7 +465,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
break;
case Name_kind:
if (ctx == Store && !forbidden_check(c, n,
(char *)PyUnicode_AsUTF8String(e->v.Name.id)))
PyUnicode_AsUTF8(e->v.Name.id)))
return 0;
e->v.Name.ctx = ctx;
break;
Expand Down Expand Up @@ -2203,7 +2203,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
return NULL;
}
key = e->v.Name.id;
if (!forbidden_check(c, CHILD(ch, 0), (char *)PyUnicode_AsUTF8String(key)))
if (!forbidden_check(c, CHILD(ch, 0), PyUnicode_AsUTF8(key)))
return NULL;
for (k = 0; k < nkeywords; k++) {
tmp = _PyUnicode_AsString(
Expand Down