@@ -2976,7 +2976,6 @@ math_ulp_impl(PyObject *module, double x)
29762976static int
29772977math_exec (PyObject * module )
29782978{
2979-
29802979 if (PyModule_Add (module , "pi" , PyFloat_FromDouble (Py_MATH_PI )) < 0 ) {
29812980 return -1 ;
29822981 }
@@ -2993,32 +2992,6 @@ math_exec(PyObject *module)
29932992 if (PyModule_Add (module , "nan" , PyFloat_FromDouble (fabs (Py_NAN ))) < 0 ) {
29942993 return -1 ;
29952994 }
2996-
2997- PyObject * intmath = PyImport_ImportModule ("_math_integer" );
2998- if (!intmath ) {
2999- return -1 ;
3000- }
3001- #define IMPORT_FROM_INTMATH (NAME ) do { \
3002- if (PyModule_Add(module, #NAME, \
3003- PyObject_GetAttrString(intmath, #NAME)) < 0) { \
3004- Py_DECREF(intmath); \
3005- return -1; \
3006- } \
3007- } while(0)
3008-
3009- IMPORT_FROM_INTMATH (comb );
3010- IMPORT_FROM_INTMATH (factorial );
3011- IMPORT_FROM_INTMATH (gcd );
3012- IMPORT_FROM_INTMATH (isqrt );
3013- IMPORT_FROM_INTMATH (lcm );
3014- IMPORT_FROM_INTMATH (perm );
3015- if (_PyImport_SetModuleString ("math.integer" , intmath ) < 0 ) {
3016- Py_DECREF (intmath );
3017- return -1 ;
3018- }
3019- if (PyModule_Add (module , "integer" , intmath ) < 0 ) {
3020- return -1 ;
3021- }
30222995 return 0 ;
30232996}
30242997
@@ -3095,15 +3068,15 @@ PyDoc_STRVAR(module_doc,
30953068
30963069static struct PyModuleDef mathmodule = {
30973070 PyModuleDef_HEAD_INIT ,
3098- .m_name = "math " ,
3071+ .m_name = "_math " ,
30993072 .m_doc = module_doc ,
31003073 .m_size = 0 ,
31013074 .m_methods = math_methods ,
31023075 .m_slots = math_slots ,
31033076};
31043077
31053078PyMODINIT_FUNC
3106- PyInit_math (void )
3079+ PyInit__math (void )
31073080{
31083081 return PyModuleDef_Init (& mathmodule );
31093082}
0 commit comments