Installing the error handler

So far, our exception hook is installed (assigned to maya.utils.formatGuiException) when the excepthandling module is imported. This is a problem because it means excepthandling needs to be imported for the exception hook to be assigned. If you have a whole suite of tools, you will need to make sure excepthandling is imported early on. If you are distributing lots of separate tools, you will want to make sure each one imports excepthandling.

There is another problem, though. Imagine two people have read this chapter and created their own excepthook replacements which are assigned over maya.utils.formatGuiException. These two people then write and release some scripts. These two scripts are then installed by the same ...

Get Practical Maya Programming with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.