From 5546291c91eae85718498f20e0f22cf360ffb5c4 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Wed, 5 Aug 2026 23:31:22 +0800 Subject: [PATCH] add `PermissionError` --- include/pocketpy/pocketpy.h | 1 + src/interpreter/vm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/pocketpy/pocketpy.h b/include/pocketpy/pocketpy.h index bf7e8f3e..7237a157 100644 --- a/include/pocketpy/pocketpy.h +++ b/include/pocketpy/pocketpy.h @@ -864,6 +864,7 @@ enum py_PredefinedType { tp_SyntaxError, tp_RecursionError, tp_OSError, + tp_PermissionError, tp_NotImplementedError, tp_TypeError, tp_IndexError, diff --git a/src/interpreter/vm.c b/src/interpreter/vm.c index dd4d7acb..ca2e182e 100644 --- a/src/interpreter/vm.c +++ b/src/interpreter/vm.c @@ -195,6 +195,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_OSError); INJECT_BUILTIN_EXC(NotImplementedError, tp_Exception); INJECT_BUILTIN_EXC(TypeError, tp_Exception); INJECT_BUILTIN_EXC(IndexError, tp_Exception);