Remove null argument for QtValueError

This commit is contained in:
Florian Bruhin 2017-04-03 10:18:56 +02:00
parent 2c3fcda18e
commit cb4c64eec9

View File

@ -406,15 +406,12 @@ class QtValueError(ValueError):
"""Exception which gets raised by ensure_valid.""" """Exception which gets raised by ensure_valid."""
def __init__(self, obj, null=False): def __init__(self, obj):
try: try:
self.reason = obj.errorString() self.reason = obj.errorString()
except AttributeError: except AttributeError:
self.reason = None self.reason = None
if null: err = "{} is not valid".format(obj)
err = "{} is null".format(obj)
else:
err = "{} is not valid".format(obj)
if self.reason: if self.reason:
err += ": {}".format(self.reason) err += ": {}".format(self.reason)
super().__init__(err) super().__init__(err)