fix traceback in samples/hsndling_events.py, #211