Update signals.py for compatibility with python3.4