Skip to content

Commit 8e485ca

Browse files
committed
[GR-17148] Avoid assertion, because it runs too early on SVM
PullRequest: graalpython/590
2 parents 0ba1376 + 68cab9f commit 8e485ca

File tree

1 file changed

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

1 file changed

+4
-5
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
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-
6058
@ExportLibrary(PythonObjectLibrary.class)
6159
public class PythonObject extends PythonAbstractObject {
6260
public static final HiddenKey HAS_DICT = new HiddenKey("has_dict");
@@ -242,9 +240,10 @@ protected static interface PythonObjectLayout {
242240
private static final Shape emptyShape = PythonObjectLayoutImpl.INSTANCE.createPythonObjectShape(null).getShape();
243241

244242
public static Shape freshShape(LazyPythonClass klass) {
245-
if (!ImageInfo.inImageCode()) {
246-
assert (PythonLanguage.getCurrent().singleContextAssumption.isValid() && klass != null) || klass instanceof PythonBuiltinClassType;
247-
}
243+
// GR-17243: I would like to enable this assertion, but it breaks
244+
// building native images under some circumstances.
245+
// assert (PythonLanguage.getCurrent().singleContextAssumption.isValid()
246+
// && klass != null) || klass instanceof PythonBuiltinClassType;
248247
return PythonObjectLayoutImpl.INSTANCE.createPythonObjectShape(klass).getShape();
249248
}
250249

0 commit comments

Comments
 (0)