Both these `try..except` blocks should live in `compat.py`