trimesh.exceptions module

exceptions.py

Handle things related to exceptions.

Classes

ExceptionModule(exc)

Create a dummy module which will raise an exception when attributes are accessed.

Functions

closure(exc)

Return a function which will accept any arguments but raise the exception when called.

class trimesh.exceptions.ExceptionModule(exc)

Bases: object

Create a dummy module which will raise an exception when attributes are accessed.

For soft dependencies we want to survive failing to import but we would like to raise an appropriate error when the functionality is actually requested so the user gets an easily debuggable message.

trimesh.exceptions.closure(exc)

Return a function which will accept any arguments but raise the exception when called.

Parameters

exc (Exception) – Will be raised later

Returns

failed – When called will raise exc

Return type

function