Report objects when raising type error (#1554)
Give better error report when replacing non-hy objects
This commit is contained in:
parent
d4936c29ae
commit
af89fd68b0
@ -40,7 +40,7 @@ class HyObject(object):
|
||||
if not hasattr(self, attr) and hasattr(other, attr):
|
||||
setattr(self, attr, getattr(other, attr))
|
||||
else:
|
||||
raise TypeError("Can't replace a non Hy object with a Hy object")
|
||||
raise TypeError("Can't replace a non Hy object '{}' with a Hy object '{}'".format(repr(other), repr(self)))
|
||||
|
||||
return self
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user