kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=374f267ecc78fdedb5ae7f38628f9e61c5d04517

commit 374f267ecc78fdedb5ae7f38628f9e61c5d04517
Author: Kai Huuhko <kai.huu...@gmail.com>
Date:   Fri Oct 25 13:43:40 2013 +0300

    Fix missing symbol PyString_FromFormatV when compiled for Python 3.x.
    
    That function was removed so I replaced it with PyUnicode_FromFormatV,
    cdef extern it directly from Python.h since it's not found in Cython
    unicode.pxd.
---
 efl/utils/logger.pyx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/efl/utils/logger.pyx b/efl/utils/logger.pyx
index 471de9e..3893bbc 100644
--- a/efl/utils/logger.pyx
+++ b/efl/utils/logger.pyx
@@ -15,7 +15,6 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.
 
-from cpython cimport PyString_FromFormatV
 from libc.string cimport const_char
 from efl.eina cimport Eina_Log_Domain, const_Eina_Log_Domain, Eina_Log_Level, \
     eina_log_print_cb_set, eina_log_domain_register, eina_log_level_set, \
@@ -25,6 +24,9 @@ cdef extern from "stdarg.h":
     ctypedef struct va_list:
         pass
 
+cdef extern from "Python.h":
+    object PyUnicode_FromFormatV(char *format, va_list vargs)
+
 cdef tuple log_levels = (
     50,
     40,
@@ -39,7 +41,7 @@ cdef void py_eina_log_print_cb(const_Eina_Log_Domain *d,
                               Eina_Log_Level level,
                               const_char *file, const_char *fnc, int line,
                               const_char *fmt, void *data, va_list args) with 
gil:
-    cdef str msg = PyString_FromFormatV(fmt, args)
+    cdef unicode msg = PyUnicode_FromFormatV(fmt, args)
     rec = logging.LogRecord(d.name, log_levels[level], file, line, msg, None, 
None, fnc)
     logger = loggers.get(d.name, loggers["efl"])
     logger.handle(rec)

-- 


Reply via email to