summarylogtreecommitdiffstats
path: root/0001-Python3-patch.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Python3-patch.patch')
-rw-r--r--0001-Python3-patch.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/0001-Python3-patch.patch b/0001-Python3-patch.patch
new file mode 100644
index 000000000000..5c9bdd9cd961
--- /dev/null
+++ b/0001-Python3-patch.patch
@@ -0,0 +1,51 @@
+From 6026ffd6bf0de2ff9fe9698bc5854bcb8f2b5d56 Mon Sep 17 00:00:00 2001
+From: Sandy Carter <bwrsandman@gmail.com>
+Date: Sun, 10 Jan 2016 20:57:11 -0500
+Subject: [PATCH] Python3 patch
+
+---
+ pylircmodule.c | 14 ++++++++++++++
+ setup.py | 2 +-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/pylircmodule.c b/pylircmodule.c
+index 1ea36c2..a406c97 100644
+--- a/pylircmodule.c
++++ b/pylircmodule.c
+@@ -287,6 +287,20 @@ static PyMethodDef pylircMethods[] = {
+ };
+
+ // Python init function
++#if PY_MAJOR_VERSION >= 3
++static struct PyModuleDef pylircModule = {
++ PyModuleDef_HEAD_INIT,
++ "pylirc",
++ NULL,
++ -1,
++ pylircMethods,
++ NULL, NULL, NULL, NULL
++};
++PyMODINIT_FUNC PyInit_pylirc(void) {
++ return PyModule_Create(&pylircModule);
++}
++#else
+ void initpylirc(void) {
+ (void) Py_InitModule("pylirc", pylircMethods);
+ }
++#endif
+diff --git a/setup.py b/setup.py
+index 1f2db0d..b8dc215 100644
+--- a/setup.py
++++ b/setup.py
+@@ -18,7 +18,7 @@
+
+ from distutils.core import setup, Extension
+
+-module1 = Extension('pylircmodule',
++module1 = Extension('pylirc',
+ sources = ['pylircmodule.c'],
+ libraries = ['lirc_client'])
+
+--
+2.7.0
+