Catch AttributeError

Catch AttributeError to make it compatible with future version of spyderlib which may replace rope with jedi.
Merge pull request #7 from ningfei/develop

Once there is an official version of spyderlib with jedi, some more changes will be necessary to re-enable code completion. Until then, this should work nicely.