diff options
author | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-07-14 16:36:31 -0700 |
---|---|---|
committer | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-07-14 19:14:35 -0700 |
commit | 96579d92769c47adbaa00f8407b85f93eb856c66 (patch) | |
tree | 4f378688cdde607476e18a8f30b232cee228efc2 /src/_fastmath.c | |
parent | 52287434f824732c52ba21b771a9626c312ca4e9 (diff) | |
download | pycrypto-96579d92769c47adbaa00f8407b85f93eb856c66.tar.gz |
Py3k cleanup: PyType_Ready
Diffstat (limited to 'src/_fastmath.c')
-rw-r--r-- | src/_fastmath.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/_fastmath.c b/src/_fastmath.c index 3be1432..afbe931 100644 --- a/src/_fastmath.c +++ b/src/_fastmath.c @@ -1682,7 +1682,6 @@ init_fastmath (void) PyObject *_fastmath_dict; #ifdef IS_PY3K - /* PyType_Ready automatically fills in ob_type with &PyType_Type if it's not already set */ if (PyType_Ready(&rsaKeyType) < 0) return NULL; if (PyType_Ready(&dsaKeyType) < 0) @@ -1692,8 +1691,10 @@ init_fastmath (void) if (_fastmath_module == NULL) return NULL; #else - rsaKeyType.ob_type = &PyType_Type; - dsaKeyType.ob_type = &PyType_Type; + if (PyType_Ready(&rsaKeyType) < 0) + return; + if (PyType_Ready(&dsaKeyType) < 0) + return; _fastmath_module = Py_InitModule ("_fastmath", _fastmath__methods__); #endif _fastmath_dict = PyModule_GetDict (_fastmath_module); |