Skip to content

Commit 36b7be4

Browse files
committed
hide an assertion that may not work on SVM because of image building
1 parent a057644 commit 36b7be4

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/PythonObject.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
import com.oracle.truffle.api.object.Shape;
5656
import com.oracle.truffle.api.object.dsl.Layout;
5757

58+
import org.graalvm.nativeimage.ImageInfo;
59+
5860
@ExportLibrary(PythonObjectLibrary.class)
5961
public class PythonObject extends PythonAbstractObject {
6062
public static final HiddenKey HAS_DICT = new HiddenKey("has_dict");
@@ -240,7 +242,9 @@ protected static interface PythonObjectLayout {
240242
private static final Shape emptyShape = PythonObjectLayoutImpl.INSTANCE.createPythonObjectShape(null).getShape();
241243

242244
public static Shape freshShape(LazyPythonClass klass) {
243-
assert (PythonLanguage.getCurrent().singleContextAssumption.isValid() && klass != null) || klass instanceof PythonBuiltinClassType;
245+
if (!ImageInfo.inImageCode()) {
246+
assert (PythonLanguage.getCurrent().singleContextAssumption.isValid() && klass != null) || klass instanceof PythonBuiltinClassType;
247+
}
244248
return PythonObjectLayoutImpl.INSTANCE.createPythonObjectShape(klass).getShape();
245249
}
246250

0 commit comments

Comments
 (0)