|
82 | 82 | import com.oracle.graal.python.builtins.modules.cext.PythonCextBuiltins.CApiUnaryBuiltinNode;
|
83 | 83 | import com.oracle.graal.python.builtins.objects.PNone;
|
84 | 84 | import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject;
|
| 85 | +import com.oracle.graal.python.builtins.objects.cext.capi.CApiContext; |
85 | 86 | import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes.AsCharPointerNode;
|
86 | 87 | import com.oracle.graal.python.builtins.objects.cext.capi.PrimitiveNativeWrapper;
|
87 | 88 | import com.oracle.graal.python.builtins.objects.cext.common.CArrayWrappers.CStringWrapper;
|
|
137 | 138 | import com.oracle.graal.python.runtime.PythonContext;
|
138 | 139 | import com.oracle.graal.python.runtime.exception.PException;
|
139 | 140 | import com.oracle.truffle.api.CompilerDirectives;
|
| 141 | +import com.oracle.truffle.api.TruffleLogger; |
140 | 142 | import com.oracle.truffle.api.dsl.Bind;
|
141 | 143 | import com.oracle.truffle.api.dsl.Cached;
|
142 | 144 | import com.oracle.truffle.api.dsl.Cached.Exclusive;
|
@@ -962,6 +964,8 @@ Object get(Object obj,
|
962 | 964 |
|
963 | 965 | @CApiBuiltin(ret = Int, args = {PyObject, ConstCharPtrAsTruffleString}, call = Direct)
|
964 | 966 | abstract static class PyObject_SetDoc extends CApiBinaryBuiltinNode {
|
| 967 | + private static final TruffleLogger LOGGER = CApiContext.getLogger(PyObject_SetDoc.class); |
| 968 | + |
965 | 969 | @Specialization
|
966 | 970 | static int set(PBuiltinFunction obj, Object value,
|
967 | 971 | @Shared("write") @Cached WriteAttributeToPythonObjectNode write) {
|
@@ -1001,7 +1005,9 @@ static int set(PythonAbstractNativeObject type, Object value,
|
1001 | 1005 | @Fallback
|
1002 | 1006 | @SuppressWarnings("unused")
|
1003 | 1007 | static int set(Object obj, Object value) {
|
1004 |
| - // The callers don't expect errors, so just do nothing |
| 1008 | + CompilerDirectives.transferToInterpreterAndInvalidate(); |
| 1009 | + // The callers don't expect errors, so just warn |
| 1010 | + LOGGER.warning("Unexpected type in PyObject_SetDoc: " + obj.getClass()); |
1005 | 1011 | return 1;
|
1006 | 1012 | }
|
1007 | 1013 | }
|
|
0 commit comments