File tree Expand file tree Collapse file tree 6 files changed +12
-5
lines changed Expand file tree Collapse file tree 6 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,13 @@ PyInterpreterState* _pylzma_interpreterState;
104104#define PARSE_LENGTH_FORMAT "%d"
105105#endif
106106
107+ // Handle tp_print -> tp_vectorcall_offset change in Python 3.8+
108+ #if PY_VERSION_HEX >= 0x03080000
109+ #define PYLZMA_TP_PRINT 0
110+ #else
111+ #define PYLZMA_TP_PRINT NULL
112+ #endif
113+
107114extern ISzAlloc allocator ;
108115
109116#endif
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ CAESDecrypt_Type = {
155155 sizeof (CAESDecryptObject ), /* int tp_basicsize; */
156156 0 , /* int tp_itemsize; // not used much */
157157 NULL , /* destructor tp_dealloc; */
158- NULL , /* printfunc tp_print; */
158+ PYLZMA_TP_PRINT , /* printfunc tp_print; */
159159 NULL , /* getattrfunc tp_getattr; // __getattr__ */
160160 NULL , /* setattrfunc tp_setattr; // __setattr__ */
161161 NULL , /* cmpfunc tp_compare; // __cmp__ */
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ CCompressionFileObject_Type = {
231231 sizeof (CCompressionFileObject ), /* int tp_basicsize; */
232232 0 , /* int tp_itemsize; // not used much */
233233 (destructor )pylzma_compfile_dealloc , /* destructor tp_dealloc; */
234- NULL , /* printfunc tp_print; */
234+ PYLZMA_TP_PRINT , /* printfunc tp_print; */
235235 NULL , /* getattrfunc tp_getattr; // __getattr__ */
236236 NULL , /* setattrfunc tp_setattr; // __setattr__ */
237237 NULL , /* cmpfunc tp_compare; // __cmp__ */
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ CCompressionObject_Type = {
224224 sizeof (CCompressionObject ), /* int tp_basicsize; */
225225 0 , /* int tp_itemsize; // not used much */
226226 (destructor )pylzma_comp_dealloc , /* destructor tp_dealloc; */
227- NULL , /* printfunc tp_print; */
227+ PYLZMA_TP_PRINT , /* printfunc tp_print; */
228228 NULL , /* getattrfunc tp_getattr; // __getattr__ */
229229 NULL , /* setattrfunc tp_setattr; // __setattr__ */
230230 NULL , /* cmpfunc tp_compare; // __cmp__ */
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ CDecompressionObject_Type = {
382382 sizeof (CDecompressionObject ), /* int tp_basicsize; */
383383 0 , /* int tp_itemsize; // not used much */
384384 (destructor )pylzma_decomp_dealloc , /* destructor tp_dealloc; */
385- NULL , /* printfunc tp_print; */
385+ PYLZMA_TP_PRINT , /* printfunc tp_print; */
386386 NULL , /* getattrfunc tp_getattr; // __getattr__ */
387387 NULL , /* setattrfunc tp_setattr; // __setattr__ */
388388 NULL , /* cmpfunc tp_compare; // __cmp__ */
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ PyTypeObject CompatDecompressionObject_Type = {
202202 sizeof (CCompatDecompressionObject ), /* int tp_basicsize; */
203203 0 , /* int tp_itemsize; // not used much */
204204 (destructor )pylzma_decomp_dealloc , /* destructor tp_dealloc; */
205- NULL , /* printfunc tp_print; */
205+ PYLZMA_TP_PRINT , /* printfunc tp_print; */
206206 NULL , /* getattrfunc tp_getattr; // __getattr__ */
207207 NULL , /* setattrfunc tp_setattr; // __setattr__ */
208208 NULL , /* cmpfunc tp_compare; // __cmp__ */
You can’t perform that action at this time.
0 commit comments