diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-02-15 21:22:45 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-02-15 21:22:45 (GMT) |
commit | 60d6c7f0cc0749a8ccd29fce652971d1833cc319 (patch) | |
tree | 2414893d7b24e50c28f75736f7739f2860b06e4c /Objects/descrobject.c | |
parent | e9b9b35931c72c6c27e87c1b40ff08903395ce89 (diff) | |
download | cpython-60d6c7f0cc0749a8ccd29fce652971d1833cc319.zip cpython-60d6c7f0cc0749a8ccd29fce652971d1833cc319.tar.gz cpython-60d6c7f0cc0749a8ccd29fce652971d1833cc319.tar.bz2 |
Issue #2115: __slot__ attributes setting was 10x slower.
Also correct a possible crash using ABCs.
This change is exactly the same as an optimisation
done 5 years ago, but on slot *access*:
http://svn.python.org/view?view=rev&rev=28297
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 4b599ec..9823b74 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -166,7 +166,7 @@ descr_setcheck(PyDescrObject *descr, PyObject *obj, PyObject *value, int *pres) { assert(obj != NULL); - if (!PyObject_IsInstance(obj, (PyObject *)(descr->d_type))) { + if (!PyObject_TypeCheck(obj, descr->d_type)) { PyErr_Format(PyExc_TypeError, "descriptor '%.200s' for '%.100s' objects " "doesn't apply to '%.100s' object", |