Sorry, something went wrong.
| overlapped_clear((PyObject *)module); | ||
| } | ||
|
|
||
| #define WINAPI_CONSTANT(fmt, con) \ |
There was a problem hiding this comment.
I think that this can be converted into PyModule_AddObject instead of using PyModule_GetDict
Sorry, something went wrong.
There was a problem hiding this comment.
@corona10 You're right. Is that preferable to PyModule_GetDict? If so why?
Sorry, something went wrong.
There was a problem hiding this comment.
https://docs.python.org/3/c-api/module.html?highlight=pymodule_getdict#c.PyModule_GetDict
Sorry, something went wrong.
There was a problem hiding this comment.
@corona10 I'm trying that now. So far it is not looking good - somehow the values are all wrong. For example when I switch to PyModule_AddObject, overlapped.__dict__["ERROR_IO_PENDING"] is 6160 instead of 997. I can't figure out why..
Edit - I figured it out. I was doing a decref on the object I passed into PyModule_AddObject, but it turns out this function steals the reference so I shouldn't do that.
Sorry, something went wrong.
|
@vstinner @shihai1991 @corona10 please review |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, apart a typo in the NEWS entry. Please fix the NEWS entry, so I can merge your PR.
Sorry, something went wrong.
| @@ -0,0 +1,2 @@ | |||
| Port the :mod:`overlapped` extension module to multi-phase initialization | |||
There was a problem hiding this comment.
The module is named "_overlapped" with an underscore.
| Port the :mod:`overlapped` extension module to multi-phase initialization | |
| Port the :mod:`_overlapped` extension module to multi-phase initialization |
Sorry, something went wrong.
|
|
||
| Py_DECREF(socket_module); | ||
|
|
||
| if (initialize_function_pointers() < 0) |
There was a problem hiding this comment.
While you modify the if, please add braces for consistency with the function (PEP 7).
Sorry, something went wrong.
https://bugs.python.org/issue1635741