Many thanks for the prompt reply and the info. But why is malebolgia doing this (it seems a strange thing to do), and how can I get malebolgia to return the desired error type?
(The ValueError that malebolgia returns in this example does contain "MyError" in its message string so if all else fails then I guess I can just parse the message string.)