Fix for issue #1788: Connection objects don't check for existence of att...

...ributes in __repr__