File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,26 @@ static PyMethodDef mapcode_methods[] = {
151151};
152152
153153/* Initialisation that gets called when module is imported. */
154+ #if PY_MAJOR_VERSION >= 3
155+ PyMODINIT_FUNC PyInit_mapcode (void )
156+ {
157+ static struct PyModuleDef mapcode_module = {
158+ PyModuleDef_HEAD_INIT ,
159+ "mapcode" , /* m_name */
160+ mapcode_doc , /* m_doc */
161+ -1 , /* m_size */
162+ mapcode_methods , /* m_methods */
163+ NULL , /* m_reload */
164+ NULL , /* m_traverse */
165+ NULL , /* m_clear */
166+ NULL , /* m_free */
167+ };
168+
169+ return (PyModule_Create (& mapcode_module ));
170+ }
171+ #else
154172PyMODINIT_FUNC initmapcode (void )
155173{
156174 Py_InitModule3 ("mapcode" , mapcode_methods , mapcode_doc );
157175}
176+ #endif
Original file line number Diff line number Diff line change 33
44from distutils .core import setup , Extension
55
6+ module_version = '2.0.0.2'
67
78setup (
89 name = 'mapcode' ,
910 ext_modules = [Extension ('mapcode' ,
1011 sources = ['mapcodemodule.c' , 'mapcodelib/mapcoder.c' ],
1112 include_dirs = ['mapcodelib' ]
1213 )],
13- version = '2.0.0.0' ,
14+ version = module_version ,
1415 description = 'A Python module to do mapcode encoding and decoding. See http://www.mapcode.com for more information.' ,
1516 author = 'Erik Bos' ,
1617 author_email = 'erik@xs4all.nl' ,
1718 url = 'https://github.com/mapcode-foundation/mapcode-python' ,
18- download_url = 'https://github.com/mapcode-foundation/mapcode-python/tarball/v2.0.0.1' ,
19+ download_url = 'https://github.com/mapcode-foundation/mapcode-python/tarball/v' + module_version ,
1920 license = 'Apache License 2.0' ,
2021 classifiers = [
2122 'Development Status :: 5 - Production/Stable' ,
You can’t perform that action at this time.
0 commit comments