diff --git a/py/objstr.c b/py/objstr.c
index c44e9ebf16e3ee47ded23e4efea57f5318f96e24..33bfcc37561545ac75b67de97ef2137cb3551c6a 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;
diff --git a/tests/basics/int1.py b/tests/basics/int1.py
index 2daef9bf0e3415d218028fae869691484045ee6c..e8a0a04683ce5a931afe5b366bbcb10814ac6c8b 100644
--- a/tests/basics/int1.py
+++ b/tests/basics/int1.py
@@ -46,6 +46,7 @@ print(int('0B100', 2))
 print(int('0100', 2))
 print(int(' \t 0o12', 8))
 print(int('0o12  \t  ', 8))
+print(int(b"12", 10))
 
 
 def test(value, base):