mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-02-05 17:28:23 +08:00
support FileNoFoundError for runSingleFile
This commit is contained in:
parent
ee42c10a7b
commit
908b187493
2
port/linux/.vscode/launch.json
vendored
2
port/linux/.vscode/launch.json
vendored
@ -24,7 +24,7 @@
|
||||
// "--gtest_filter=vm.test_cmodule_import_as"
|
||||
// "--gtest_filter=vm.subsrc_import"
|
||||
// "--gtest_filter=event.event_thread"
|
||||
"--gtest_filter=stddata.pikafs_open"
|
||||
"--gtest_filter=vm.run_no_file"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
|
@ -1762,7 +1762,8 @@ enum shellCTRL _inner_do_obj_runChar(PikaObj* self,
|
||||
shell->line_position - shell->line_curpos);
|
||||
shell->lineBuff[shell->line_position + 1] = 0;
|
||||
if (shell->line_curpos != shell->line_position) {
|
||||
pika_platform_printf("%s", shell->lineBuff + shell->line_curpos + 1);
|
||||
pika_platform_printf("%s",
|
||||
shell->lineBuff + shell->line_curpos + 1);
|
||||
_putc_cmd(PIKA_KEY_LEFT,
|
||||
shell->line_position - shell->line_curpos);
|
||||
}
|
||||
|
@ -4021,9 +4021,8 @@ VMParameters* pikaVM_runByteCodeFile(PikaObj* self, char* filename) {
|
||||
VMParameters* pikaVM_runSingleFile(PikaObj* self, char* filename) {
|
||||
Args buffs = {0};
|
||||
Arg* file_arg = arg_loadFile(NULL, filename);
|
||||
pika_assert(NULL != file_arg);
|
||||
if (NULL == file_arg) {
|
||||
pika_platform_printf("Error: can not open file '%s'\n", filename);
|
||||
pika_platform_printf("FileNotFoundError: %s\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
char* lines = (char*)arg_getBytes(file_arg);
|
||||
|
@ -2,4 +2,4 @@
|
||||
#define PIKA_VERSION_MINOR 13
|
||||
#define PIKA_VERSION_MICRO 3
|
||||
|
||||
#define PIKA_EDIT_TIME "2024/03/11 09:01:07"
|
||||
#define PIKA_EDIT_TIME "2024/04/03 11:11:49"
|
||||
|
Loading…
x
Reference in New Issue
Block a user