diff options
author | Guido van Rossum <guido@python.org> | 2001-08-16 08:27:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-08-16 08:27:33 (GMT) |
commit | 8098ddbe814325c7869f7d63aa102019b353c6b6 (patch) | |
tree | 929d7350b692aacd2d04466ace7f52e7f89d0837 /Objects/descrobject.c | |
parent | f6309e8ecf293f5dbab031b1b8068771d5ac9a8f (diff) | |
download | cpython-8098ddbe814325c7869f7d63aa102019b353c6b6.zip cpython-8098ddbe814325c7869f7d63aa102019b353c6b6.tar.gz cpython-8098ddbe814325c7869f7d63aa102019b353c6b6.tar.bz2 |
Subtle change to make None.__class__ work:
- descrobject.c:descr_check(): only believe None means the same as
NULL if the type given is None's type.
- typeobject.c:wrap_descr_get(): don't "conventiently" default an
absent type to the type of the object argument. Let the called
function figure it out.
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 40629f6..a2ecde5 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -91,9 +91,9 @@ wrapper_repr(PyWrapperDescrObject *descr) static int descr_check(PyDescrObject *descr, PyObject *obj, PyTypeObject *type, - PyObject **pres) + PyObject **pres) { - if (obj == NULL || obj == Py_None) { + if (obj == NULL || (obj == Py_None && type != Py_None->ob_type)) { Py_INCREF(descr); *pres = (PyObject *)descr; return 1; |