chiark
/
gitweb
/
~mdw
/
pyke
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d53428c
)
pyke/pyke.c (newtype): Explicitly clear `ht_slots'.
author
Mark Wooding
<mdw@distorted.org.uk>
Tue, 22 Oct 2019 17:53:50 +0000
(18:53 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:44:14 +0000
(12:44 +0100)
This makes things go very badly wrong in Python 3. I'm not sure why it
doesn't go wrong in Python 2...
pyke.c
patch
|
blob
|
blame
|
history
diff --git
a/pyke.c
b/pyke.c
index f19c9e41301a2903a72075eef0c0459b9343dc53..29dd8c51ae178b2d2c5e32f65544d0b4fd620da7 100644
(file)
--- a/
pyke.c
+++ b/
pyke.c
@@
-237,6
+237,7
@@
void *newtype(PyTypeObject *metaty,
ty->ht_name = PyString_FromString(ty->ht_type.tp_name);
if (ty->ht_name)
ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name);
+ ty->ht_slots = 0;
(void)PyObject_INIT(&ty->ht_type, metaty);
Py_INCREF(metaty);
return (ty);