summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 15:17:02 +0200
committerWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 15:17:02 +0200
commit57668bcdd086145eb14598e32fd5d0dca711865c (patch)
tree28098dcae1531fde2a2c4a510ba123b860f35b2d /python
parent91977939eb7add4c503795a1e0b3fe6938b07404 (diff)
parent0f4969c3011910518639e3dd9ff6c1e4b2539f4c (diff)
downloadastra-57668bcdd086145eb14598e32fd5d0dca711865c.tar.gz
astra-57668bcdd086145eb14598e32fd5d0dca711865c.tar.bz2
astra-57668bcdd086145eb14598e32fd5d0dca711865c.tar.xz
astra-57668bcdd086145eb14598e32fd5d0dca711865c.zip
Merge pull request #65 from dmpelt/cython-char-fix
Hold reference to results of six.b calls
Diffstat (limited to 'python')
-rw-r--r--python/astra/log_c.pyx21
1 files changed, 14 insertions, 7 deletions
diff --git a/python/astra/log_c.pyx b/python/astra/log_c.pyx
index 969cc06..f16329f 100644
--- a/python/astra/log_c.pyx
+++ b/python/astra/log_c.pyx
@@ -52,16 +52,20 @@ cdef extern from "astra/Logging.h" namespace "astra::CLogger":
void setFormatScreen(const char *fmt)
def log_debug(sfile, sline, message):
- debug(six.b(sfile),sline,six.b(message))
+ cstr = list(map(six.b,(sfile,message)))
+ debug(cstr[0],sline,cstr[1])
def log_info(sfile, sline, message):
- info(six.b(sfile),sline,six.b(message))
+ cstr = list(map(six.b,(sfile,message)))
+ info(cstr[0],sline,cstr[1])
def log_warn(sfile, sline, message):
- warn(six.b(sfile),sline,six.b(message))
+ cstr = list(map(six.b,(sfile,message)))
+ warn(cstr[0],sline,cstr[1])
def log_error(sfile, sline, message):
- error(six.b(sfile),sline,six.b(message))
+ cstr = list(map(six.b,(sfile,message)))
+ error(cstr[0],sline,cstr[1])
def log_enable():
enable()
@@ -82,10 +86,12 @@ def log_disableFile():
disableFile()
def log_setFormatFile(fmt):
- setFormatFile(six.b(fmt))
+ cstr = six.b(fmt)
+ setFormatFile(cstr)
def log_setFormatScreen(fmt):
- setFormatScreen(six.b(fmt))
+ cstr = six.b(fmt)
+ setFormatScreen(cstr)
enumList = [LOG_DEBUG,LOG_INFO,LOG_WARN,LOG_ERROR]
@@ -93,4 +99,5 @@ def log_setOutputScreen(fd, level):
setOutputScreen(fd, enumList[level])
def log_setOutputFile(filename, level):
- setOutputFile(six.b(filename), enumList[level]) \ No newline at end of file
+ cstr = six.b(filename)
+ setOutputFile(cstr, enumList[level])