File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ints Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,9 @@ public abstract static class TrueDivNode extends PythonBinaryBuiltinNode {
347
347
348
348
@ Specialization
349
349
double doPI (long left , PInt right ) {
350
+ if (right .isZero ()) {
351
+ throw raise (PythonErrorType .ZeroDivisionError , "division by zero" );
352
+ }
350
353
return op (PInt .longToBigInteger (left ), right .getValue ());
351
354
}
352
355
@@ -411,7 +414,10 @@ public abstract static class RTrueDivNode extends PythonBinaryBuiltinNode {
411
414
412
415
@ Specialization
413
416
double doPL (PInt right , long left ) {
414
- return op (right .getValue (), PInt .longToBigInteger (left ));
417
+ if (right .isZero ()) {
418
+ throw raise (PythonErrorType .ZeroDivisionError , "division by zero" );
419
+ }
420
+ return op (PInt .longToBigInteger (left ), right .getValue ());
415
421
}
416
422
417
423
@ Specialization
You can’t perform that action at this time.
0 commit comments