summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-11 13:51:24 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-11 13:51:24 +0300
commiteea01186547f0f1568ea1c8f002da4e33b7b0e46 (patch)
treeb0663dd0a1b965bd1bfa5e29d3b19c56f8eaf03d /py
parentb2d4fc06fc95d8e96eabd6ef470f0e871275fb82 (diff)
downloadmicropython-eea01186547f0f1568ea1c8f002da4e33b7b0e46.tar.gz
micropython-eea01186547f0f1568ea1c8f002da4e33b7b0e46.zip
py: Give up and make mp_obj_str_get_data() deal with bytes too.
This is not fully correct re: error handling, because we should check that that types are used consistently (only str's or only bytes), but magically makes lot of functions support bytes.
Diffstat (limited to 'py')
-rw-r--r--py/objstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c
index c44e9ebf16..33bfcc3756 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -1647,7 +1647,7 @@ const char *mp_obj_str_get_str(mp_obj_t self_in) {
}
const char *mp_obj_str_get_data(mp_obj_t self_in, uint *len) {
- if (MP_OBJ_IS_STR(self_in)) {
+ if (is_str_or_bytes(self_in)) {
GET_STR_DATA_LEN(self_in, s, l);
*len = l;
return (const char*)s;