From c84376bd27df14f44005c7f9f173c079e495e78a Mon Sep 17 00:00:00 2001 From: byehack Date: Fri, 22 Mar 2019 18:19:21 +0430 Subject: [PATCH 1/2] support py3.x on windows [Py_InitModule error] --- ext/rle.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ext/rle.c b/ext/rle.c index 2d7da8d..54d96aa 100644 --- a/ext/rle.c +++ b/ext/rle.c @@ -939,9 +939,17 @@ static PyMethodDef rle_methods[] = {NULL, NULL, 0, NULL} }; -PyMODINIT_FUNC -initrle(void) +static struct PyModuleDef rle = { - (void) Py_InitModule("rle", rle_methods); + PyModuleDef_HEAD_INIT, + "rle", /* name of module */ + "", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + rle_methods +}; + +PyMODINIT_FUNC PyInit_rle(void) +{ + return PyModule_Create(&rle); } From 0b29a607c11ddf479a99d319479fd0db02791908 Mon Sep 17 00:00:00 2001 From: byehack Date: Fri, 22 Mar 2019 18:20:13 +0430 Subject: [PATCH 2/2] support py3.x on windows [Py_InitModule error] --- rdpy/core/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdpy/core/log.py b/rdpy/core/log.py index 7522141..6caa1de 100644 --- a/rdpy/core/log.py +++ b/rdpy/core/log.py @@ -39,7 +39,7 @@ def log(message): @summary: Main log function @param message: string to print """ - print "[*] %s"%message + print ("[*] %s"%message) def error(message): """ @@ -75,4 +75,4 @@ def debug(message): """ if _LOG_LEVEL > Level.DEBUG: return - log("DEBUG:\t%s"%message) \ No newline at end of file + log("DEBUG:\t%s"%message)