Skip to content

Commit a51eb87

Browse files
committed
Drop Python 2 remnants from genecodes.py
1 parent 4c1e2b7 commit a51eb87

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2016 Georgi Valkov. All rights reserved.
1+
Copyright (c) 2012-2023 Georgi Valkov. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without
44
modification, are permitted provided that the following conditions are

evdev/genecodes.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
{ NULL, NULL, 0, NULL}
4848
};
4949
50-
#if PY_MAJOR_VERSION >= 3
5150
static struct PyModuleDef moduledef = {
5251
PyModuleDef_HEAD_INIT,
5352
MODULE_NAME,
@@ -59,38 +58,17 @@
5958
NULL, /* m_clear */
6059
NULL, /* m_free */
6160
};
62-
#endif
6361
64-
static PyObject *
65-
moduleinit(void)
62+
PyMODINIT_FUNC
63+
PyInit__ecodes(void)
6664
{
67-
68-
#if PY_MAJOR_VERSION >= 3
6965
PyObject* m = PyModule_Create(&moduledef);
70-
#else
71-
PyObject* m = Py_InitModule3(MODULE_NAME, MethodTable, MODULE_HELP);
72-
#endif
73-
7466
if (m == NULL) return NULL;
7567
7668
%s
7769
7870
return m;
7971
}
80-
81-
#if PY_MAJOR_VERSION >= 3
82-
PyMODINIT_FUNC
83-
PyInit__ecodes(void)
84-
{
85-
return moduleinit();
86-
}
87-
#else
88-
PyMODINIT_FUNC
89-
init_ecodes(void)
90-
{
91-
moduleinit();
92-
}
93-
#endif
9472
'''
9573

9674
def parse_header(header):

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
'Programming Language :: Python :: 3.8',
2525
'Programming Language :: Python :: 3.9',
2626
'Programming Language :: Python :: 3.10',
27+
'Programming Language :: Python :: 3.11',
2728
'Operating System :: POSIX :: Linux',
2829
'Intended Audience :: Developers',
2930
'Topic :: Software Development :: Libraries',

0 commit comments

Comments
 (0)