Make TreeEntry not to inherit from Object
Tree entries are not Git objects like commits, blobs, etc. By inheriting from Object it was even possible to produce a segfault when accessing inherited attributes like 'type'.
This commit is contained in:
1
pygit2.c
1
pygit2.c
@@ -1896,7 +1896,6 @@ initpygit2(void)
|
|||||||
CommitType.tp_new = PyType_GenericNew;
|
CommitType.tp_new = PyType_GenericNew;
|
||||||
if (PyType_Ready(&CommitType) < 0)
|
if (PyType_Ready(&CommitType) < 0)
|
||||||
return;
|
return;
|
||||||
TreeEntryType.tp_base = &ObjectType;
|
|
||||||
TreeEntryType.tp_new = PyType_GenericNew;
|
TreeEntryType.tp_new = PyType_GenericNew;
|
||||||
if (PyType_Ready(&TreeEntryType) < 0)
|
if (PyType_Ready(&TreeEntryType) < 0)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user