Restore Python 2 module init function
Python bindings: set appropriate exceptions when failing