Skip to content

Commit 2248ef0

Browse files
authored
Misc changes (#732)
1 parent ebe9aaa commit 2248ef0

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

Src/IronPython/Runtime/Operations/StringOps.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,10 +2023,10 @@ private static PythonList SplitInternal(string self, string separator, int maxsp
20232023

20242024
private static void TryStringOrTuple(object prefix) {
20252025
if (prefix == null) {
2026-
throw PythonOps.TypeError("expected string or Tuple, got NoneType");
2026+
throw PythonOps.TypeError("expected string or tuple, got NoneType");
20272027
}
20282028
if (!(prefix is string) && !(prefix is PythonTuple) && !(prefix is Extensible<string>)) {
2029-
throw PythonOps.TypeError("expected string or Tuple, got {0} Type", prefix.GetType());
2029+
throw PythonOps.TypeError("expected string or tuple, got {0}", DynamicHelpers.GetPythonType(prefix).Name);
20302030
}
20312031
}
20322032

Src/IronPython/Runtime/PythonFunction.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -523,21 +523,15 @@ public object cell_contents {
523523

524524
#region ICodeFormattable Members
525525

526-
public string/*!*/ __repr__(CodeContext/*!*/ context) {
527-
return String.Format("<cell at {0}: {1}>",
528-
IdDispenser.GetId(this),
529-
GetContentsRepr()
530-
);
531-
}
526+
public string/*!*/ __repr__(CodeContext/*!*/ context)
527+
=> $"<cell at 0x{IdDispenser.GetId(this):X}: {GetContentsRepr()}>";
532528

533529
private string GetContentsRepr() {
534530
if (Value == Uninitialized.Instance) {
535531
return "empty";
536532
}
537533

538-
return String.Format("{0} object at {1}",
539-
PythonTypeOps.GetName(Value),
540-
IdDispenser.GetId(Value));
534+
return $"{PythonTypeOps.GetName(Value)} object at 0x{IdDispenser.GetId(Value):X}";
541535
}
542536

543537
#endregion

Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,6 @@ Ignore=true
978978
[AllCPython.test_unicodedata]
979979
Ignore=true
980980

981-
[AllCPython.test_univnewlines]
982-
Ignore=true
983-
Reason=TypeError: FileIO() takes at most 3 arguments (4 given)
984-
985981
[AllCPython.test_urllib]
986982
Ignore=true
987983
Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/issues/182

0 commit comments

Comments
 (0)