Skip to content

Commit f2e8032

Browse files
authored
Override DefaultLanguage (#964)
1 parent 6c9880d commit f2e8032

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

Src/IronPython/Runtime/Operations/StringOps.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,8 +2085,7 @@ private static PythonList SplitInternal(string self, char[]? seps, int maxsplit)
20852085

20862086
// If the optional second argument sep is absent or None, the words are separated
20872087
// by arbitrary strings of whitespace characters (space, tab, newline, return, formfeed);
2088-
string[] r = StringUtils.Split(
2089-
self,
2088+
string[] r = self.Split(
20902089
seps,
20912090
(maxsplit < 0) ? Int32.MaxValue : maxsplit + 1,
20922091
(seps == null) ? StringSplitOptions.RemoveEmptyEntries : StringSplitOptions.None);
@@ -2100,7 +2099,7 @@ private static PythonList SplitInternal(string self, string separator, int maxsp
21002099
if (String.IsNullOrEmpty(self)) {
21012100
return SplitEmptyString(separator != null);
21022101
} else {
2103-
string[] r = StringUtils.Split(self, separator, (maxsplit < 0) ? Int32.MaxValue : maxsplit + 1, StringSplitOptions.None);
2102+
string[] r = self.Split(new[] { separator }, (maxsplit < 0) ? Int32.MaxValue : maxsplit + 1, StringSplitOptions.None);
21042103

21052104
PythonList ret = new PythonList(r.Length);
21062105
foreach (string s in r) ret.AddNoLock(s);

Src/IronPython/Runtime/PythonContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ public override void GetExceptionMessage(Exception exception, out string message
16151615
/// <summary>
16161616
/// Gets the default encoding for this system state / engine.
16171617
/// </summary>
1618-
public Encoding DefaultEncoding { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
1618+
public override Encoding DefaultEncoding { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
16191619

16201620
public string GetDefaultEncodingName()
16211621
=> DefaultEncoding.WebName.ToLower().Replace('-', '_');

0 commit comments

Comments
 (0)