You can also get rid of that catch, I think it's related to that below
```python
port = int(memcache_ports[i])
```
might be an old thing that we badly moved. 
It's not needed anymore