Skip to content

Commit 0954f74

Browse files
committed
Raise correct error in __flags__ descriptor.
1 parent f9e7260 commit 0954f74

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,13 +1149,13 @@ Object setNative(@SuppressWarnings("unused") PythonAbstractNativeObject cls, @Su
11491149
@GenerateNodeFactory
11501150
abstract static class FlagsNode extends PythonUnaryBuiltinNode {
11511151
@Specialization(limit = "3")
1152-
static Object doGeneric(Object self,
1152+
Object doGeneric(Object self,
11531153
@CachedLibrary("self") InteropLibrary lib,
11541154
@Cached GetTypeFlagsNode getTypeFlagsNode) {
11551155
if (PGuards.isClass(self, lib)) {
11561156
return getTypeFlagsNode.execute(self);
11571157
}
1158-
return PNone.NO_VALUE;
1158+
throw raise(PythonErrorType.TypeError, "descriptor '__flags__' for 'type' objects doesn't apply to '%p' object", self);
11591159
}
11601160
}
11611161
}

0 commit comments

Comments
 (0)