def _getStringValue(val):
    try:
        if isinstance(val, xmlrpclib.ServerProxy):
            rval = "<Server Proxy>"
        elif hasattr(val, 'asString'):
            rval = val.asString()
        elif inspect.isclass(val):
            rval = '<Class %s.%s>' % (val.__module__, val.__name__)
        elif not hasattr(val, '__str__'):
            if hasattr(val, '__class__'):
                rval = '<unprintable of class %s>' % val.__class__
            else:
                rval = '<unprintable>'
        else:
            rval = val
        return rval
    except Exception, e:
        try:
            return '<Exception occurred while converting %s to string: %s' %(repr(val), e)
        except Exception, e:
            return '<Exception occurred while converting to repr: %s' +(e)
dataset/ETHPy150Open sassoftware/conary/conary/lib/stackutil.py/_getStringValue/operator `%` -> `+`