This should be:
```python
if signal is not None:
```