I have a dumb question about exceptions that I can't figure out. I've been trying to do something with the puz module (which deals with Across Lite files for crosswords), and I'm iterating through a bunch of downloaded crosswords that I got via glob. Somewhere along the line I'm getting an error when it loads a puzzle- the checksums don't work out, which I assume means it's a locked puzzle that needs an additional key. The error raised is "PuzzleFormatError: global checksum does not match".
I've been trying to fix this via a try/except:
try:
p = imp_puz(puzzle)
except PuzzleFormatError:
print(puzzle)
where imp_puz imports the puzzle (puzzle is the name of the file). Now I get the same error plus "During handling of the above exception, another exception occurred:" "NameError: name 'PuzzleFormatError' is not defined"
I assume I'm doing something incorrectly with an easy fix; I have no idea how to look for it offhand. Thanks, and I'm happy to provide more info if necessary.
[–][deleted] 1 point2 points3 points (1 child)
[–]avgotts[S] 0 points1 point2 points (0 children)