Skip to content

Commit 3c76203

Browse files
committed
Revert "Avoid get class when the object is python class"
This reverts commit 8d7c757. This change was breaking pytorch and there is nothing in CPython source that would support its existence. I wasn't able to find what it was attempting to fix. Whatever it was, it needs to be fixed in a different way.
1 parent aaf831d commit 3c76203

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/argument/CreateArgumentsNode.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import com.oracle.graal.python.builtins.objects.module.PythonModule;
5757
import com.oracle.graal.python.builtins.objects.object.PythonObject;
5858
import com.oracle.graal.python.builtins.objects.str.PString;
59-
import com.oracle.graal.python.builtins.objects.type.PythonClass;
6059
import com.oracle.graal.python.nodes.ErrorMessages;
6160
import com.oracle.graal.python.nodes.PGuards;
6261
import com.oracle.graal.python.nodes.PNodeWithContext;
@@ -478,8 +477,7 @@ static void doEnclosingTypeCheck(@SuppressWarnings("unused") Signature signature
478477
@Cached GetClassNode getClassNode,
479478
@Cached IsSubtypeNode isSubtypeMRONode,
480479
@Cached PRaiseNode raiseNode) {
481-
Object derived = self instanceof PythonClass ? self : getClassNode.execute(self);
482-
if (!isSubtypeMRONode.execute(derived, callable.getEnclosingType())) {
480+
if (!isSubtypeMRONode.execute(getClassNode.execute(self), callable.getEnclosingType())) {
483481
CompilerDirectives.transferToInterpreterAndInvalidate();
484482
throw raiseNode.raise(PythonBuiltinClassType.TypeError, "descriptor '%s' for '%p' objects doesn't apply to a '%p' object",
485483
callable.getName(), callable.getEnclosingType(), self);

0 commit comments

Comments
 (0)