Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,9 @@ Ignore=true
[AllCPython.test_docxmlrpc]
Ignore=true

[AllCPython.test_email_codecs]
Ignore=true
IsolationLevel=ENGINE

[AllCPython.test_email]
Ignore=true

[AllCPython.test_email_renamed]
Ignore=true

[AllCPython.test_enumerate]
Ignore=true
Reason=Causes StackOverflowException
Expand Down
19 changes: 10 additions & 9 deletions Src/IronPythonTest/Util/IniParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ public string GetValue(string sectionName, string key) {
public string GetValue(string sectionName, string key, string @default) {
sectionName = string.IsNullOrEmpty(sectionName) ? "DEFAULT" : sectionName;

Section section;
if (!this.options.TryGetValue(sectionName, out section)) {
section = this.options["DEFAULT"];
}

string value;
if (!section.TryGetValue(key, out value)) {
if (!this.options["DEFAULT"].TryGetValue(key, out value)) {
return @default;
while ((sectionName = GetParentSection(sectionName, out Section section)) != null) {
if (section.TryGetValue(key, out value)) {
return value;
}
}

return value;
return options["DEFAULT"].TryGetValue(key, out value) ? value : @default;
}

private string GetParentSection(string sectionName, out Section section) {
var idx = sectionName.LastIndexOf('.');
var newSectionName = idx == -1 ? null : sectionName.Substring(0, idx);
return options.TryGetValue(sectionName, out section) || newSectionName == null ? newSectionName : GetParentSection(newSectionName, out section);
}

public bool GetBool(string sectionName, string key) {
Expand Down