[PATCH 2/5] python: improve example with signals and exceptions