add create exceptions source code in Python