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 55
55
import com .oracle .truffle .api .object .Shape ;
56
56
import com .oracle .truffle .api .object .dsl .Layout ;
57
57
58
+ import org .graalvm .nativeimage .ImageInfo ;
59
+
58
60
@ ExportLibrary (PythonObjectLibrary .class )
59
61
public class PythonObject extends PythonAbstractObject {
60
62
public static final HiddenKey HAS_DICT = new HiddenKey ("has_dict" );
@@ -240,7 +242,9 @@ protected static interface PythonObjectLayout {
240
242
private static final Shape emptyShape = PythonObjectLayoutImpl .INSTANCE .createPythonObjectShape (null ).getShape ();
241
243
242
244
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
+ }
244
248
return PythonObjectLayoutImpl .INSTANCE .createPythonObjectShape (klass ).getShape ();
245
249
}
246
250
You can’t perform that action at this time.
0 commit comments