@@ -4636,14 +4636,6 @@ MODINIT_DEFINE(math)
4636
4636
NULL ,
4637
4637
NULL };
4638
4638
4639
- /* initialize the extension types */
4640
- if ((PyType_Ready (& pgVector2_Type ) < 0 ) ||
4641
- (PyType_Ready (& pgVector3_Type ) < 0 ) ||
4642
- (PyType_Ready (& pgVectorIter_Type ) < 0 ) ||
4643
- (PyType_Ready (& pgVectorElementwiseProxy_Type ) < 0 )) {
4644
- return NULL ;
4645
- }
4646
-
4647
4639
/* initialize the module */
4648
4640
module = PyModule_Create (& _module );
4649
4641
@@ -4652,15 +4644,10 @@ MODINIT_DEFINE(math)
4652
4644
}
4653
4645
4654
4646
/* add extension types to module */
4655
- if ((PyModule_AddObjectRef (module , "Vector2" ,
4656
- (PyObject * )& pgVector2_Type ) < 0 ) ||
4657
- (PyModule_AddObjectRef (module , "Vector3" ,
4658
- (PyObject * )& pgVector3_Type ) < 0 ) ||
4659
- (PyModule_AddObjectRef (module , "VectorElementwiseProxy" ,
4660
- (PyObject * )& pgVectorElementwiseProxy_Type ) <
4661
- 0 ) ||
4662
- (PyModule_AddObjectRef (module , "VectorIterator" ,
4663
- (PyObject * )& pgVectorIter_Type ) < 0 )) {
4647
+ if ((PyModule_AddType (module , & pgVector2_Type ) < 0 ) ||
4648
+ (PyModule_AddType (module , & pgVector3_Type ) < 0 ) ||
4649
+ (PyModule_AddType (module , & pgVectorElementwiseProxy_Type ) < 0 ) ||
4650
+ (PyModule_AddType (module , & pgVectorIter_Type ) < 0 )) {
4664
4651
Py_DECREF (module );
4665
4652
return NULL ;
4666
4653
}
0 commit comments