Skip to content

Commit ae5676a

Browse files
committed
Remove _bz2 only if running in native launcher.
1 parent 7e13a82 commit ae5676a

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/Python3Core.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ public final void postInitialize() {
920920
* would never include the intrinsified _bz2 module in the native image since native
921921
* access is never allowed during native image build time.
922922
*/
923-
if (!getContext().isNativeAccessAllowed()) {
923+
if (ImageInfo.inImageCode() && !getContext().isNativeAccessAllowed()) {
924924
builtinModules.remove(BuiltinNames.BZ2);
925925
sysModules.delItem(BuiltinNames.BZ2);
926926
}

0 commit comments

Comments
 (0)