diff --git a/Src/IronPython.Modules/ResourceMetaPathImporter.cs b/Src/IronPython.Modules/ResourceMetaPathImporter.cs
index a3c444e2d..1353de8b8 100644
--- a/Src/IronPython.Modules/ResourceMetaPathImporter.cs
+++ b/Src/IronPython.Modules/ResourceMetaPathImporter.cs
@@ -69,6 +69,11 @@ fully qualified (dotted) module name. It returns the importer
with the importer protocol."
)]
public object find_module(CodeContext /*!*/ context, string fullname, params object[] args) {
+ PythonContext pc = context.LanguageContext;
+
+ if (pc.BuiltinModules.TryGetValue(fullname, out Type type))
+ return null;
+
var packedName = MakeFilename(fullname);
foreach (var entry in SearchOrder) {
@@ -106,7 +111,7 @@ public object load_module(CodeContext /*!*/ context, string fullname) {
ModuleOptions.None, out script);
var dict = mod.__dict__;
- // we do these here because we don't want CompileModule to initialize the module until we've set
+ // we do these here because we don't want CompileModule to initialize the module until we've set
// up some additional stuff
dict.Add("__name__", fullname);
dict.Add("__loader__", this);
@@ -174,7 +179,7 @@ private byte[] GetCodeFromData(CodeContext /*!*/ context, bool isbytecode, Packe
if (data != null) {
if (isbytecode) {
- // would put in code to unmarshal the bytecode here...
+ // would put in code to unmarshal the bytecode here...
}
else {
code = data;
diff --git a/Src/IronPython/Runtime/Operations/PythonOps.cs b/Src/IronPython/Runtime/Operations/PythonOps.cs
index 380c5006f..183526c52 100644
--- a/Src/IronPython/Runtime/Operations/PythonOps.cs
+++ b/Src/IronPython/Runtime/Operations/PythonOps.cs
@@ -1673,6 +1673,19 @@ public static PythonList MakeEmptyList() {
return new PythonList();
}
+ ///
+ /// Python runtime helper to create an instance of Python List object.
+ ///
+ /// List has the initial provided capacity.
+ ///
+ /// Initial list capacity
+ ///
+ [NoSideEffects]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PythonList MakeEmptyList(int capacity) {
+ return new PythonList(capacity);
+ }
+
///
/// Python runtime helper to create an instance of Tuple
///
diff --git a/Src/IronPython/Runtime/Operations/StringOps.cs b/Src/IronPython/Runtime/Operations/StringOps.cs
index 9a3e98a7c..fd8d02c4b 100644
--- a/Src/IronPython/Runtime/Operations/StringOps.cs
+++ b/Src/IronPython/Runtime/Operations/StringOps.cs
@@ -391,6 +391,11 @@ public static string capitalize([NotNone] this string self) {
return Char.ToUpper(self[0], CultureInfo.InvariantCulture) + self.Substring(1).ToLower(CultureInfo.InvariantCulture);
}
+ ///
+ /// Returns a copy of this string converted to lowercase
+ ///
+ public static string casefold([NotNone] this string self) => lower(self);
+
// default fillchar (padding char) is a space
public static string center([NotNone] this string self, int width) {
return center(self, width, ' ');