File tree 14 files changed +20
-24
lines changed
14 files changed +20
-24
lines changed Original file line number Diff line number Diff line change 14
14
- Make the Py_LOCAL_INLINE macro to work with Python 2.6, 2.7 and 3.1
15
15
- Use surrogateescape in Python 3, see PEP-383
16
16
- Expose the ODB (Repository.odb)
17
- - According to Python documentation, tp_dealloc must call tp_free (instead of
18
- PyObject_Del or similar) if the type is subclassable. So, go through the
19
- code and switch to tp_free, or make the type not subclassable, on a case by
20
- case basis.
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ PyTypeObject BlameHunkType = {
170
170
0 , /* tp_getattro */
171
171
0 , /* tp_setattro */
172
172
0 , /* tp_as_buffer */
173
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
173
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
174
174
BlameHunk__doc__ , /* tp_doc */
175
175
0 , /* tp_traverse */
176
176
0 , /* tp_clear */
@@ -233,7 +233,7 @@ PyTypeObject BlameIterType = {
233
233
0 , /* tp_getattro */
234
234
0 , /* tp_setattro */
235
235
0 , /* tp_as_buffer */
236
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
236
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
237
237
BlameIter__doc__ , /* tp_doc */
238
238
0 , /* tp_traverse */
239
239
0 , /* tp_clear */
@@ -362,7 +362,7 @@ PyTypeObject BlameType = {
362
362
0 , /* tp_getattro */
363
363
0 , /* tp_setattro */
364
364
0 , /* tp_as_buffer */
365
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
365
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
366
366
Blame__doc__ , /* tp_doc */
367
367
0 , /* tp_traverse */
368
368
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ PyTypeObject BlobType = {
181
181
0 , /* tp_getattro */
182
182
0 , /* tp_setattro */
183
183
0 , /* tp_as_buffer */
184
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
184
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
185
185
Blob__doc__ , /* tp_doc */
186
186
0 , /* tp_traverse */
187
187
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ PyTypeObject CommitType = {
259
259
0 , /* tp_getattro */
260
260
0 , /* tp_setattro */
261
261
0 , /* tp_as_buffer */
262
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
262
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
263
263
Commit__doc__ , /* tp_doc */
264
264
0 , /* tp_traverse */
265
265
0 , /* tp_clear */
Original file line number Diff line number Diff line change 92
92
Config_dealloc (Config * self )
93
93
{
94
94
git_config_free (self -> config );
95
- PyObject_Del (self );
95
+ Py_TYPE ( self ) -> tp_free (self );
96
96
}
97
97
98
98
PyDoc_STRVAR (Config_get_global_config__doc__ ,
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ PyTypeObject PatchType = {
207
207
0 , /* tp_getattro */
208
208
0 , /* tp_setattro */
209
209
0 , /* tp_as_buffer */
210
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
210
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
211
211
Patch__doc__ , /* tp_doc */
212
212
0 , /* tp_traverse */
213
213
0 , /* tp_clear */
@@ -269,7 +269,7 @@ PyTypeObject DiffIterType = {
269
269
0 , /* tp_getattro */
270
270
0 , /* tp_setattro */
271
271
0 , /* tp_as_buffer */
272
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
272
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
273
273
DiffIter__doc__ , /* tp_doc */
274
274
0 , /* tp_traverse */
275
275
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ Index_dealloc(Index* self)
71
71
PyObject_GC_UnTrack (self );
72
72
Py_XDECREF (self -> repo );
73
73
git_index_free (self -> index );
74
- PyObject_GC_Del (self );
74
+ Py_TYPE ( self ) -> tp_free (self );
75
75
}
76
76
77
77
int
561
561
IndexIter_dealloc (IndexIter * self )
562
562
{
563
563
Py_CLEAR (self -> owner );
564
- PyObject_Del (self );
564
+ Py_TYPE ( self ) -> tp_free (self );
565
565
}
566
566
567
567
PyObject *
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ PyTypeObject NoteType = {
134
134
0 , /* tp_getattro */
135
135
0 , /* tp_setattro */
136
136
0 , /* tp_as_buffer */
137
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
137
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
138
138
Note__doc__ , /* tp_doc */
139
139
0 , /* tp_traverse */
140
140
0 , /* tp_clear */
@@ -200,7 +200,7 @@ PyTypeObject NoteIterType = {
200
200
0 , /* tp_getattro */
201
201
0 , /* tp_setattro */
202
202
0 , /* tp_as_buffer */
203
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
203
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
204
204
NoteIter__doc__ , /* tp_doc */
205
205
0 , /* tp_traverse */
206
206
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Object_dealloc(Object* self)
45
45
{
46
46
Py_CLEAR (self -> repo );
47
47
git_object_free (self -> obj );
48
- PyObject_Del (self );
48
+ Py_TYPE ( self ) -> tp_free (self );
49
49
}
50
50
51
51
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ PyTypeObject RefLogIterType = {
97
97
0 , /* tp_getattro */
98
98
0 , /* tp_setattro */
99
99
0 , /* tp_as_buffer */
100
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
100
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
101
101
RefLogIterType__doc__ , /* tp_doc */
102
102
0 , /* tp_traverse */
103
103
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -658,7 +658,7 @@ PyTypeObject RemoteType = {
658
658
0 , /* tp_getattro */
659
659
0 , /* tp_setattro */
660
660
0 , /* tp_as_buffer */
661
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
661
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
662
662
Remote__doc__ , /* tp_doc */
663
663
0 , /* tp_traverse */
664
664
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ Repository_dealloc(Repository *self)
105
105
Py_CLEAR (self -> index );
106
106
Py_CLEAR (self -> config );
107
107
git_repository_free (self -> repo );
108
- PyObject_GC_Del (self );
108
+ Py_TYPE ( self ) -> tp_free (self );
109
109
}
110
110
111
111
int
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ PyTypeObject TagType = {
151
151
0 , /* tp_getattro */
152
152
0 , /* tp_setattro */
153
153
0 , /* tp_as_buffer */
154
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
154
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
155
155
Tag__doc__ , /* tp_doc */
156
156
0 , /* tp_traverse */
157
157
0 , /* tp_clear */
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ PyTypeObject TreeEntryType = {
170
170
0 , /* tp_getattro */
171
171
0 , /* tp_setattro */
172
172
0 , /* tp_as_buffer */
173
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
173
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
174
174
TreeEntry__doc__ , /* tp_doc */
175
175
0 , /* tp_traverse */
176
176
0 , /* tp_clear */
@@ -518,7 +518,7 @@ PyTypeObject TreeType = {
518
518
0 , /* tp_getattro */
519
519
0 , /* tp_setattro */
520
520
0 , /* tp_as_buffer */
521
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
521
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
522
522
Tree__doc__ , /* tp_doc */
523
523
0 , /* tp_traverse */
524
524
0 , /* tp_clear */
@@ -589,7 +589,7 @@ PyTypeObject TreeIterType = {
589
589
0 , /* tp_getattro */
590
590
0 , /* tp_setattro */
591
591
0 , /* tp_as_buffer */
592
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
592
+ Py_TPFLAGS_DEFAULT , /* tp_flags */
593
593
TreeIter__doc__ , /* tp_doc */
594
594
0 , /* tp_traverse */
595
595
0 , /* tp_clear */
You can’t perform that action at this time.
0 commit comments