Qix- / better-exceptions

Pretty and useful exceptions in Python, automatically.
MIT License
4.59k stars 203 forks source link

why "export BETTER_EXCEPTIONS=1" works? #115

Closed FateScript closed 3 years ago

FateScript commented 3 years ago

Hi, thanks for your awesome project :)

I'm curious about why just exporting an env variable could make hook fucntion register expectionhook to python.

This doesn't seem straightforward compared with next two lines of code:

from better_exceptions import hook
hook()

Beg your explanation, thanks.

FateScript commented 3 years ago

Oh, I see. It seems that code here reigisters your hook.pth.