Skip to content

Commit d27a849

Browse files
committed
Add empty unraisablehook
1 parent a9e2166 commit d27a849

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/BuiltinNames.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public abstract class BuiltinNames {
5959
public static final String DISPLAYHOOK = "displayhook";
6060
public static final String BREAKPOINTHOOK = "breakpointhook";
6161
public static final String EXCEPTHOOK = "excepthook";
62+
public static final String UNRAISABLEHOOK = "unraisablehook";
6263
public static final String LAST_TYPE = "last_type";
6364
public static final String LAST_VALUE = "last_value";
6465
public static final String LAST_TRACEBACK = "last_traceback";

graalpython/lib-graalpython/sys.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ def __print_traceback__(typ, value, tb):
199199
del make_excepthook
200200

201201

202+
def make_unraisablehook():
203+
def __unraisablehook__(unraisable, /):
204+
# We don't currently use it and there's no way to construct the parameter in python code (internal type)
205+
pass
206+
207+
return __unraisablehook__
208+
209+
210+
__unraisablehook__ = make_unraisablehook()
211+
unraisablehook = __unraisablehook__
212+
del make_unraisablehook
213+
214+
202215
@__graalpython__.builtin
203216
def breakpointhook(*args, **kws):
204217
import importlib, os, warnings

0 commit comments

Comments
 (0)