Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

        def lookup_attr(obj, key):
    try:
        return getattr(obj, key)
    except AttributeError:
        exc = sys.exc_info()[1]
        try:
            get = obj.__getitem__
        except AttributeError:
            raise exc
        try:
            return get(key)
        except KeyError:
            raise exc
        


src/c/h/Chameleon-2.15/src/chameleon/tales.py   Chameleon(Download)
 
try:
    from .py26 import lookup_attr
except SyntaxError:
    from .py25 import lookup_attr

src/c/h/chameleon-HEAD/src/chameleon/tales.py   chameleon(Download)
 
try:
    from .py26 import lookup_attr
except SyntaxError:
    from .py25 import lookup_attr