Compare commits

..

4 Commits

Author SHA1 Message Date
Tesselmax Opensource
d7520ab48a
Merge 46cc281099bfad78ee697e700330314307235695 into 7baf64e67c7c88f736aff9a3329c69fe4723a137 2026-08-06 00:14:13 +08:00
blueloveTH
7baf64e67c Update vm.c 2026-08-06 00:13:25 +08:00
blueloveTH
7435251873 Update os.c 2026-08-05 23:41:56 +08:00
blueloveTH
5546291c91 add PermissionError 2026-08-05 23:31:22 +08:00
3 changed files with 3 additions and 0 deletions

View File

@ -871,6 +871,7 @@ enum py_PredefinedType {
tp_SyntaxError,
tp_RecursionError,
tp_OSError,
tp_PermissionError,
tp_NotImplementedError,
tp_TypeError,
tp_IndexError,

View File

@ -196,6 +196,7 @@ void VM__ctor(VM* self) {
INJECT_BUILTIN_EXC(SyntaxError, tp_Exception);
INJECT_BUILTIN_EXC(RecursionError, tp_Exception);
INJECT_BUILTIN_EXC(OSError, tp_Exception);
INJECT_BUILTIN_EXC(PermissionError, tp_Exception);
INJECT_BUILTIN_EXC(NotImplementedError, tp_Exception);
INJECT_BUILTIN_EXC(TypeError, tp_Exception);
INJECT_BUILTIN_EXC(IndexError, tp_Exception);

View File

@ -48,6 +48,7 @@ static bool os_chdir(int argc, py_Ref argv) {
}
static bool os_getcwd(int argc, py_Ref argv) {
PY_CHECK_ARGC(0);
char buf[1024];
if(!platform_getcwd(buf, sizeof(buf))) return OSError("getcwd() failed");
py_newstr(py_retval(), buf);