Catch AttributeError

Catch AttributeError to make it compatible with future version of spyderlib which may replace rope with jedi.