Skip to content

Commit 325cdf6

Browse files
committed
Make is_native_object into a debug builtin
1 parent 17734a2 commit 325cdf6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def assert_raises(err, fn, *args, **kwargs):
5959

6060

6161
if sys.implementation.name == 'graalpy':
62-
is_native_object = __graalpython__.is_native_object
62+
is_native_object = getattr(__graalpython__, 'is_native_object', None)
63+
if not is_native_object:
64+
raise RuntimeError("Needs to be run with --python.EnableDebuggingBuiltins")
6365
else:
6466
def is_native_object(obj):
6567
return True

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ public void postInitialize(Python3Core core) {
248248
mod.setAttribute(tsLiteral("tdebug"), PNone.NO_VALUE);
249249
mod.setAttribute(tsLiteral("set_storage_strategy"), PNone.NO_VALUE);
250250
mod.setAttribute(tsLiteral("dump_heap"), PNone.NO_VALUE);
251+
mod.setAttribute(tsLiteral("is_native_object"), PNone.NO_VALUE);
251252
}
252253
}
253254

0 commit comments

Comments
 (0)