summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2012-06-10 22:40:53 +0000
committerKai Huuhko <kai.huuhko@gmail.com>2012-06-10 22:40:53 +0000
commit09aca8b77141c0a9eb21c7c555f93765e1eb311a (patch)
tree5ef10122ce726f6cc4b8fb258db323b71c59ed0c
parent2a550ec48d7f4bdeecea0c18352f3d31b2ab4660 (diff)
python-bindings: Check for None in the string conv functions.
SVN revision: 71925
-rw-r--r--ecore/ecore.c_ecore.pyx4
1 files changed, 4 insertions, 0 deletions
diff --git a/ecore/ecore.c_ecore.pyx b/ecore/ecore.c_ecore.pyx
index 7427c5b..e81f560 100644
--- a/ecore/ecore.c_ecore.pyx
+++ b/ecore/ecore.c_ecore.pyx
@@ -40,6 +40,8 @@ cdef unicode _ctouni(const_char_ptr s):
40 40
41cdef char* _fruni(s): 41cdef char* _fruni(s):
42 cdef char* c_string 42 cdef char* c_string
43 if not s:
44 return NULL
43 if isinstance(s, unicode): 45 if isinstance(s, unicode):
44 string = s.encode('UTF-8') 46 string = s.encode('UTF-8')
45 c_string = string 47 c_string = string
@@ -51,6 +53,8 @@ cdef char* _fruni(s):
51 53
52cdef const_char_ptr _cfruni(s): 54cdef const_char_ptr _cfruni(s):
53 cdef const_char_ptr c_string 55 cdef const_char_ptr c_string
56 if not s:
57 return NULL
54 if isinstance(s, unicode): 58 if isinstance(s, unicode):
55 string = s.encode('UTF-8') 59 string = s.encode('UTF-8')
56 c_string = string 60 c_string = string