Skip to content

Commit 53c1e63

Browse files
committed
Fix functools.partial
Fixes #213
1 parent 4ebf538 commit 53c1e63

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/BinaryArithmetic.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ public abstract static class BinaryArithmeticNode extends BinaryOpNode {
145145

146146
static Supplier<NotImplementedHandler> createHandler(String operator) {
147147
return () -> new NotImplementedHandler() {
148+
@Child private PRaiseNode raiseNode = PRaiseNode.create();
148149

149150
@Override
150151
public Object execute(VirtualFrame frame, Object arg, Object arg2) {
151-
throw PRaiseNode.getUncached().raise(TypeError, getErrorMessage(arg), operator, arg, arg2);
152+
throw raiseNode.raise(TypeError, getErrorMessage(arg), operator, arg, arg2);
152153
}
153154

154155
@CompilerDirectives.TruffleBoundary

graalpython/lib-graalpython/_functools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __new__(cls, func, /, *args, **keywords):
119119
if not callable(func):
120120
raise TypeError("the first argument must be callable")
121121

122-
if hasattr(func, "func"):
122+
if type(func) == partial:
123123
args = func.args + args
124124
keywords = {**func.keywords, **keywords}
125125
func = func.func

0 commit comments

Comments
 (0)