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
commit85bb36fc5ecc17e8338dd328c534a6319da32ed8 (patch)
tree4e4ca65802d36da6cc0763fb7655f4ec1278a90d
parentd0a804db8d04cb5b72c683b49d5e453b75bb88ce (diff)
python-bindings: Check for None in the string conv functions.
SVN revision: 71925
-rw-r--r--edje/edje.c_edje.pyx4
1 files changed, 4 insertions, 0 deletions
diff --git a/edje/edje.c_edje.pyx b/edje/edje.c_edje.pyx
index 7e87f8f..9335790 100644
--- a/edje/edje.c_edje.pyx
+++ b/edje/edje.c_edje.pyx
@@ -38,6 +38,8 @@ cdef unicode _ctouni(const_char_ptr s):
38 38
39cdef char* _fruni(s): 39cdef char* _fruni(s):
40 cdef char* c_string 40 cdef char* c_string
41 if not s:
42 return NULL
41 if isinstance(s, unicode): 43 if isinstance(s, unicode):
42 string = s.encode('UTF-8') 44 string = s.encode('UTF-8')
43 c_string = string 45 c_string = string
@@ -49,6 +51,8 @@ cdef char* _fruni(s):
49 51
50cdef const_char_ptr _cfruni(s): 52cdef const_char_ptr _cfruni(s):
51 cdef const_char_ptr c_string 53 cdef const_char_ptr c_string
54 if not s:
55 return NULL
52 if isinstance(s, unicode): 56 if isinstance(s, unicode):
53 string = s.encode('UTF-8') 57 string = s.encode('UTF-8')
54 c_string = string 58 c_string = string