Skip to content

Commit a55c99b

Browse files
committed
Fix: do never return 'null' for '__module__'.
1 parent f7608da commit a55c99b

File tree

1 file changed

+6
-3
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+6
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeBuiltins.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,12 +634,16 @@ Object getModule(@SuppressWarnings("unused") PythonAbstractNativeObject cls, @Su
634634
}
635635

636636
@TruffleBoundary
637-
private static String getModuleName(String fqname) {
637+
private Object getModuleName(String fqname) {
638638
int firstDotIdx = fqname.indexOf('.');
639639
if (firstDotIdx != -1) {
640640
return fqname.substring(0, firstDotIdx);
641641
}
642-
return null;
642+
return getBuiltinsName();
643+
}
644+
645+
protected String getBuiltinsName() {
646+
return getCore().getBuiltins().getModuleName();
643647
}
644648
}
645649

@@ -692,5 +696,4 @@ private static String getQualName(String fqname) {
692696
}
693697

694698
}
695-
696699
}

0 commit comments

Comments
 (0)