diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-09-08 07:43:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 07:43:54 (GMT) |
commit | ddb536ba7b7c6022424e39d666c3cc81772645c0 (patch) | |
tree | 48ba8d3f97ac4b4b060c910db81cf48bb16ba896 /Objects/typeobject.c | |
parent | 9f2b3d4c2899f9caea2e47063061a76e460ac618 (diff) | |
download | cpython-ddb536ba7b7c6022424e39d666c3cc81772645c0.zip cpython-ddb536ba7b7c6022424e39d666c3cc81772645c0.tar.gz cpython-ddb536ba7b7c6022424e39d666c3cc81772645c0.tar.bz2 |
[3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)
(cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 271b935..cb5e235 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -22,9 +22,9 @@ #define MCACHE_HASH_METHOD(type, name) \ MCACHE_HASH((type)->tp_version_tag, \ ((PyASCIIObject *)(name))->hash) -#define MCACHE_CACHEABLE_NAME(name) \ - PyUnicode_CheckExact(name) && \ - PyUnicode_READY(name) != -1 && \ +#define MCACHE_CACHEABLE_NAME(name) \ + PyUnicode_CheckExact(name) && \ + PyUnicode_IS_READY(name) && \ PyUnicode_GET_LENGTH(name) <= MCACHE_MAX_ATTR_SIZE struct method_cache_entry { |