This should be:

```
except requests.exceptions.RequestException as e:
```