Skip to content

Commit a30f647

Browse files
committed
Add missing may_raise decorator
1 parent 978f999 commit a30f647

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ abstract static class PyTruffleWriteUnraisable extends PythonBuiltinNode {
725725
Object run(PBaseException exception, Object object,
726726
@Cached WriteUnraisableNode writeUnraisableNode) {
727727
writeUnraisableNode.execute(null, exception, null, (object instanceof PNone) ? PNone.NONE : object);
728+
getContext().setCaughtException(PException.NO_EXCEPTION);
728729
return PNone.NO_VALUE;
729730
}
730731
}

graalpython/lib-graalpython/python_cext.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ def PyTruffle_Object_LEN(obj):
289289

290290
##################### BYTES
291291

292+
@may_raise(-1)
292293
def PyBytes_AsStringCheckEmbeddedNull(obj, encoding):
293294
if not PyBytes_Check(obj):
294295
raise TypeError('expected bytes, {!s} found'.format(type(obj)))
@@ -312,6 +313,7 @@ def PyBytes_Concat(original, newpart):
312313
return original + newpart
313314

314315

316+
@may_raise
315317
def PyBytes_FromFormat(fmt, args):
316318
formatted = fmt % args
317319
return formatted.encode()

0 commit comments

Comments
 (0)