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:
William S Fulton 2016-04-02 18:06:03 +01:00
commit a97441613e
3 changed files with 19 additions and 6 deletions

View file

@ -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