Update: I have reviewed the LyX file and it appears that the line is not actually indented; it only appears that way due to the page formatting, at least on my system. So, if you are having difficulties, just be aware that the try and except lines should have the same indentation level.
A reader was kind enough to let me know that an error is located in the book. On page 72 (Chapter 10, Listing 10.3), line 8 should not be indented. The except line should be on the same level as the try. If you have been trying to make the program work and it keeps failing, this is most likely the reason why.
I will be updating the book and posting new files when the opportunity permits. Making the change is easy. The hard part is making all the conversions.
I will post an announcement when the revised version files are available.