Do not test for sys.exc_info(); it was already present in Python 2.1. This simplifies code and improves performance (very slightly). In two places, object type was tested by calling type() on each of two values and comparing the results (4 dict lookups, 2 Python->C function calls). Replace each with an isinstance() call comparing to a saved type object (3 dict lookups, 1 Python->C function call, more future-proof).
Showing
Please register or sign in to comment