Since both except blocks do the same thing you should combine them into a single except block which covers both exception types.