Immortalize '__main__'
This commit is contained in:
parent
5345006580
commit
2ed41a0fb0
@ -942,10 +942,7 @@ _finishArgs:
|
|||||||
"provide color highlighting of the input line.");
|
"provide color highlighting of the input line.");
|
||||||
|
|
||||||
if (moduleAsMain) {
|
if (moduleAsMain) {
|
||||||
krk_push(OBJECT_VAL(krk_copyString("__main__",8)));
|
int out = !krk_importModule(AS_STRING(AS_LIST(argList)->values[0]), S("__main__"));
|
||||||
int out = !krk_importModule(
|
|
||||||
AS_STRING(AS_LIST(argList)->values[0]),
|
|
||||||
AS_STRING(krk_peek(0)));
|
|
||||||
if (krk_currentThread.flags & KRK_THREAD_HAS_EXCEPTION) {
|
if (krk_currentThread.flags & KRK_THREAD_HAS_EXCEPTION) {
|
||||||
krk_dumpTraceback();
|
krk_dumpTraceback();
|
||||||
krk_resetStack();
|
krk_resetStack();
|
||||||
|
@ -68,3 +68,4 @@ SPECIAL_ATTRS(BIN, "__bin__")
|
|||||||
SPECIAL_ATTRS(ABS, "__abs__")
|
SPECIAL_ATTRS(ABS, "__abs__")
|
||||||
SPECIAL_ATTRS(FUNC, "__func__")
|
SPECIAL_ATTRS(FUNC, "__func__")
|
||||||
SPECIAL_ATTRS(BLDCLS, "__build_class__")
|
SPECIAL_ATTRS(BLDCLS, "__build_class__")
|
||||||
|
SPECIAL_ATTRS(MAIN, "__main__")
|
||||||
|
Loading…
Reference in New Issue
Block a user