Home  >  Q&A  >  body text

python - Where is the source code of Exception implementation?

I want to see the source code implementation of exceptions, and found that they are all inherited from the built-in Exception, but I have been looking for it for a long time and can’t find it. I can’t find it even by searching with grep. I don’t know where its implementation source code is?

过去多啦不再A梦过去多啦不再A梦2733 days ago588

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-18 11:02:33

    In objects/exceptions.c, the specific exception definition may not be as obvious as the one reported by python, but you can check the relevant information in this source code file through the exception name reported by it

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-18 11:02:33

    here

    https://github.com/python/cpy...

    reply
    0
  • Cancelreply