File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 5555import com .oracle .truffle .api .object .Shape ;
5656import com .oracle .truffle .api .object .dsl .Layout ;
5757
58+ import org .graalvm .nativeimage .ImageInfo ;
59+
5860@ ExportLibrary (PythonObjectLibrary .class )
5961public 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
You can’t perform that action at this time.
0 commit comments