I think your current code works, but the following may be a bit more robust / cleaner: ``assert e.errno == 17``