Skip to content

Commit 31ff66a

Browse files
authored
Update DLR (#752)
* Update DLR * Fix test_cgcheck
1 parent db62bd2 commit 31ff66a

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

Src/DLR

Submodule DLR updated 80 files

Src/IronPython/Modules/sys.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public static void setdefaultencoding(CodeContext context, object name) {
268268
throw PythonOps.LookupError("'{0}' does not match any available encodings", strName);
269269
}
270270

271-
pc.DefaultEncoding = enc;
271+
pc.SetDefaultEncoding(enc);
272272
}
273273

274274
#if PROFILE_SUPPORT

Src/IronPython/Runtime/Operations/StringOps.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ private static List SplitInternal(string self, char[] seps, int maxsplit) {
20932093
// If the optional second argument sep is absent or None, the words are separated
20942094
// by arbitrary strings of whitespace characters (space, tab, newline, return, formfeed);
20952095

2096-
r = StringUtils.Split(self, seps, (maxsplit < 0) ? Int32.MaxValue : maxsplit + 1,
2096+
r = self.Split(seps, (maxsplit < 0) ? Int32.MaxValue : maxsplit + 1,
20972097
(seps == null) ? StringSplitOptions.RemoveEmptyEntries : StringSplitOptions.None);
20982098

20992099
List ret = PythonOps.MakeEmptyList(r.Length);

Src/IronPython/Runtime/PythonContext.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,9 +1781,10 @@ public override void GetExceptionMessage(Exception exception, out string message
17811781
/// <summary>
17821782
/// Gets or sets the default encoding for this system state / engine.
17831783
/// </summary>
1784-
public Encoding DefaultEncoding {
1785-
get { return _defaultEncoding; }
1786-
set { _defaultEncoding = value; }
1784+
public override Encoding DefaultEncoding => _defaultEncoding;
1785+
1786+
public void SetDefaultEncoding(Encoding encoding) {
1787+
_defaultEncoding = encoding;
17871788
}
17881789

17891790
public string GetDefaultEncodingName() {

Src/Scripts/generate_comdispatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def write_accessor(self, cw, transparent):
9090

9191
def write_accessor_propertyinfo(self, cw):
9292
if self.emitAccessors == True :
93-
cw.write('case VarEnum.VT_%s: return typeof(Variant).GetProperty("%s");' % (self.variantType, self.accessorName))
93+
cw.write('case VarEnum.VT_%s: return typeof(Variant).GetProperty(nameof(Variant.%s));' % (self.variantType, self.accessorName))
9494

9595
def write_byref_setters(self, cw):
9696
if self.emitAccessors == True :
97-
cw.write('case VarEnum.VT_%s: return typeof(Variant).GetMethod("SetAsByref%s");' % (self.variantType, self.name))
97+
cw.write('case VarEnum.VT_%s: return typeof(Variant).GetMethod(nameof(Variant.SetAsByref%s));' % (self.variantType, self.name))
9898

9999
def write_ComToManagedPrimitiveTypes(self, cw):
100100
wrapper_types = ["CY", "DISPATCH", "UNKNOWN", "ERROR"]

0 commit comments

Comments
 (0)