1

Closed

Missing __repr__ causes problems

description

(created from http://pytools.codeplex.com/discussions/527400#post1199705)

I just had to handle the case where there is no __repr__ of type(obj), which is sometimes the case for Python-wrapped VTK objects (I don't know why there is not even standard __repr__ working for these type objects), because I had always AttributeError exceptions raised in visualstudio_py_util.py. It was (around line 175) :
    def _repr(self, obj, level):
        '''Returns an iterable of the parts in the final repr string.'''
        obj_repr = type(obj).__repr__
        ....
and I added simple global exception handling to avoid AttributeError exceptions mentionned above:
        def _repr(self, obj, level):
        '''Returns an iterable of the parts in the final repr string.'''
        try:
          obj_repr = type(obj).__repr__
        except Exception,e:
          obj_repr = None
        ....

comments

Zooba wrote Jan 28 at 6:02 PM

This is already fixed.