Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-12 00:08:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-12 00:08:15 +0300
commitd21f44546951a29cea5524fcd2147e08de996c7d (patch)
treec34d1c61efe627fe30053eefd2085b32f0127b49 /source/blender/python
parent7952ed872acceafbfec9e161b48f16059cf31804 (diff)
PyAPI: remove Python 3.7x compatibility code
This removes Python version checks needed to build with 3.8+ and 3.7x. Ref D10381
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops.c6
-rw-r--r--source/blender/python/generic/idprop_py_api.c24
-rw-r--r--source/blender/python/generic/imbuf_py_api.c14
-rw-r--r--source/blender/python/intern/bpy_app_translations.c6
-rw-r--r--source/blender/python/intern/bpy_capi_utils.h4
-rw-r--r--source/blender/python/intern/bpy_library_load.c10
-rw-r--r--source/blender/python/intern/bpy_rna.c76
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c16
8 files changed, 46 insertions, 110 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index 03a890d315c..c5d72a00ce3 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -167,11 +167,7 @@ static PyTypeObject bmesh_op_Type = {
0, /* tp_itemsize */
/* methods */
NULL, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL,
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index fd996c8a1a2..daa604a3fbf 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -1192,12 +1192,8 @@ PyTypeObject BPy_IDGroup_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ NULL, /* destructor tp_dealloc; */
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
@@ -1605,12 +1601,8 @@ PyTypeObject BPy_IDArray_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ NULL, /* destructor tp_dealloc; */
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
@@ -1726,12 +1718,8 @@ PyTypeObject BPy_IDGroup_Iter_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ NULL, /* destructor tp_dealloc; */
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c
index 24029f0ca12..d05690759ce 100644
--- a/source/blender/python/generic/imbuf_py_api.c
+++ b/source/blender/python/generic/imbuf_py_api.c
@@ -347,15 +347,11 @@ PyTypeObject Py_ImBuf_Type = {
/* Methods to implement standard operations */
(destructor)py_imbuf_dealloc, /* destructor tp_dealloc; */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- (reprfunc)py_imbuf_repr, /* reprfunc tp_repr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
+ NULL, /* cmpfunc tp_compare; */
+ (reprfunc)py_imbuf_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index ee64d0a409c..56fc3efc090 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -795,11 +795,7 @@ static PyTypeObject BlenderAppTranslationsType = {
/* methods */
/* No destructor, this is a singleton! */
NULL, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL,
diff --git a/source/blender/python/intern/bpy_capi_utils.h b/source/blender/python/intern/bpy_capi_utils.h
index 55f8a291410..0854713982d 100644
--- a/source/blender/python/intern/bpy_capi_utils.h
+++ b/source/blender/python/intern/bpy_capi_utils.h
@@ -20,8 +20,8 @@
#pragma once
-#if PY_VERSION_HEX < 0x03070000
-# error "Python 3.7 or greater is required, you'll need to update your Python."
+#if PY_VERSION_HEX < 0x03090000
+# error "Python 3.9 or greater is required, you'll need to update your Python."
#endif
#ifdef __cplusplus
diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c
index 39d1fba2dc9..7ee563feff8 100644
--- a/source/blender/python/intern/bpy_library_load.c
+++ b/source/blender/python/intern/bpy_library_load.c
@@ -94,13 +94,9 @@ static PyTypeObject bpy_lib_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)bpy_lib_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in python 3.0! */
NULL, /* tp_repr */
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 39ba8448795..0b1af733f84 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -6404,11 +6404,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type = {
0, /* tp_itemsize */
/* methods */
NULL, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL,
@@ -6460,7 +6456,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type = {
#if defined(_MSC_VER)
NULL, /* defer assignment */
#else
- &PyType_Type, /* struct _typeobject *tp_base; */
+ &PyType_Type, /* struct _typeobject *tp_base; */
#endif
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
@@ -6489,13 +6485,9 @@ PyTypeObject pyrna_struct_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_struct_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
(reprfunc)pyrna_struct_repr, /* tp_repr */
@@ -6529,7 +6521,7 @@ PyTypeObject pyrna_struct_Type = {
/* delete references to contained objects */
(inquiry)pyrna_struct_clear, /* inquiry tp_clear; */
#else
- NULL, /* traverseproc tp_traverse; */
+ NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
@@ -6582,13 +6574,9 @@ PyTypeObject pyrna_prop_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
(reprfunc)pyrna_prop_repr, /* tp_repr */
@@ -6670,13 +6658,9 @@ PyTypeObject pyrna_prop_array_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_array_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
(reprfunc)pyrna_prop_array_repr, /* tp_repr */
@@ -6757,13 +6741,9 @@ PyTypeObject pyrna_prop_collection_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
NULL,
@@ -6847,13 +6827,9 @@ static PyTypeObject pyrna_prop_collection_idprop_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_dealloc, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
NULL,
@@ -6937,11 +6913,7 @@ PyTypeObject pyrna_func_Type = {
0, /* tp_itemsize */
/* methods */
NULL, /* tp_dealloc */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
+ 0, /* tp_vectorcall_offset */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL,
@@ -7037,13 +7009,9 @@ static PyTypeObject pyrna_prop_collection_iter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_collection_iter_dealloc, /* tp_dealloc */
-# if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-# else
- (printfunc)NULL, /* printfunc tp_print */
-# endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL,
/* tp_compare */ /* DEPRECATED in Python 3.0! */
NULL,
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 61487df1ab5..1766c7dea66 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -3042,15 +3042,11 @@ PyTypeObject vector_Type = {
/* Methods to implement standard operations */
(destructor)BaseMathObject_dealloc, /* destructor tp_dealloc; */
-#if PY_VERSION_HEX >= 0x03080000
- 0, /* tp_vectorcall_offset */
-#else
- (printfunc)NULL, /* printfunc tp_print */
-#endif
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- (reprfunc)Vector_repr, /* reprfunc tp_repr; */
+ 0, /* tp_vectorcall_offset */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
+ NULL, /* cmpfunc tp_compare; */
+ (reprfunc)Vector_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
@@ -3065,7 +3061,7 @@ PyTypeObject vector_Type = {
#ifndef MATH_STANDALONE
(reprfunc)Vector_str, /* reprfunc tp_str; */
#else
- NULL, /* reprfunc tp_str; */
+ NULL, /* reprfunc tp_str; */
#endif
NULL, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */