diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-17 11:35:35 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-17 11:35:35 +0300 |
commit | 5a515b0afe6a2bc273211ba47fd8fe04c56517c7 (patch) | |
tree | 3ad22d25ea8682901b955112ac4531c88e779c41 /Python/future.c | |
parent | ddf00b0a227950067b93a1bc828477b59aa4f78c (diff) | |
parent | 759f8db1106193b1a15bfd442eccde9522301023 (diff) | |
download | cpython-5a515b0afe6a2bc273211ba47fd8fe04c56517c7.tar.gz |
Issue #17711: Fixed unpickling by the persistent ID with protocol 0.
Original patch by Alexandre Vassalotti.
Diffstat (limited to 'Python/future.c')
-rw-r--r-- | Python/future.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/future.c b/Python/future.c index 163f87f673..75f210769e 100644 --- a/Python/future.c +++ b/Python/future.c @@ -79,7 +79,10 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename) i = 0; first = (stmt_ty)asdl_seq_GET(mod->v.Module.body, i); - if (first->kind == Expr_kind && first->v.Expr.value->kind == Str_kind) + if (first->kind == Expr_kind + && (first->v.Expr.value->kind == Str_kind + || (first->v.Expr.value->kind == Constant_kind + && PyUnicode_CheckExact(first->v.Expr.value->v.Constant.value)))) i++; |