py: Factor out mp_obj_is_package() function.
diff --git a/py/runtime.c b/py/runtime.c
index 8acd099..f701e0a 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1098,8 +1098,7 @@
     }
 
     // See if it's a package, then can try FS import
-    mp_load_method_maybe(module, MP_QSTR___path__, dest);
-    if (dest[0] == MP_OBJ_NULL) {
+    if (!mp_obj_is_package(module)) {
         goto import_error;
     }