source: {}['x'] result: python2.4 ./test.py Traceback (most recent call last): File "./test.py", line 3, in ? {}['x'] KeyError: 'x' --------- source: try: {}['x'] except Exception, e: print e.args[0] result: python2.4 ./test.py