Skip to content

Commit

Permalink
Immortalize '__main__'
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Mar 7, 2024
1 parent 5345006 commit 2ed41a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/kuroko.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__")

0 comments on commit 2ed41a0

Please sign in to comment.