Merge branch 'ahnolds-py_gettar'
* ahnolds-py_gettar: update changes file for attribute fix Add python AttributeError test for non-existent attribute Fixing python attribute lookup Conflicts: CHANGES.current
This commit is contained in:
commit
a97441613e
3 changed files with 19 additions and 6 deletions
|
|
@ -71,3 +71,13 @@ if myStringyClass.ReadWriteString != "changed string":
|
|||
raise RuntimeError
|
||||
if myStringyClass.ReadOnlyString != "changed string":
|
||||
raise RuntimeError
|
||||
|
||||
# Check a proper AttributeError is raised for non-existent attributes, old versions used to raise unhelpful error:
|
||||
# AttributeError: type object 'object' has no attribute '__getattr__'
|
||||
try:
|
||||
x = myFoo.does_not_exist
|
||||
raise RuntimeError
|
||||
except AttributeError, e:
|
||||
if str(e).find("does_not_exist") == -1:
|
||||
raise RuntimeError
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue