diff --git a/src/kuroko.c b/src/kuroko.c index e41f88e..9234e3e 100644 --- a/src/kuroko.c +++ b/src/kuroko.c @@ -942,10 +942,7 @@ int main(int argc, char * argv[]) { "provide color highlighting of the input line."); if (moduleAsMain) { - krk_push(OBJECT_VAL(krk_copyString("__main__",8))); - int out = !krk_importModule( - AS_STRING(AS_LIST(argList)->values[0]), - AS_STRING(krk_peek(0))); + int out = !krk_importModule(AS_STRING(AS_LIST(argList)->values[0]), S("__main__")); if (krk_currentThread.flags & KRK_THREAD_HAS_EXCEPTION) { krk_dumpTraceback(); krk_resetStack(); diff --git a/src/methods.h b/src/methods.h index 9522e51..ed61861 100644 --- a/src/methods.h +++ b/src/methods.h @@ -68,3 +68,4 @@ SPECIAL_ATTRS(BIN, "__bin__") SPECIAL_ATTRS(ABS, "__abs__") SPECIAL_ATTRS(FUNC, "__func__") SPECIAL_ATTRS(BLDCLS, "__build_class__") +SPECIAL_ATTRS(MAIN, "__main__")