Skip to content

Commit c211b2a

Browse files
committed
Fix compilation failures from wrong calls of error specializations
1 parent baee895 commit c211b2a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io/IOModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected static Object openText(VirtualFrame frame, Object file, IONodes.IOMode
231231

232232
/* if not buffering, returns the raw file object */
233233
if (buffering == 0) {
234-
invalidunbuf(file, mode, bufferingValue, encoding, errors, newline, closefd, opener, raiseNode);
234+
throw raiseNode.raise(inliningTarget, ValueError, CAN_T_HAVE_UNBUFFERED_TEXT_IO);
235235
}
236236

237237
/* wraps into a buffered file */

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/referencetype/ReferenceTypeBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ PReferenceType refType(Object cls, PythonAbstractNativeObject pythonObject, Obje
211211
CApiTransitions.addNativeWeakRef(getContext(), pythonObject);
212212
return PFactory.createReferenceType(language, cls, getInstanceShape.execute(cls), pythonObject, actualCallback, getWeakReferenceQueue(inliningTarget, readQueueNode));
213213
} else {
214-
return refType(cls, pythonObject, actualCallback, raiseNode);
214+
throw raiseNode.raise(inliningTarget, TypeError, ErrorMessages.CANNOT_CREATE_WEAK_REFERENCE_TO, pythonObject);
215215
}
216216
}
217217

0 commit comments

Comments
 (0)