catch ValueError thrown when the file was not found

StopIteration was never raised and the try block's scope was too big
use context manager instead of try/finally
pass is a no-op
python knows how to get a list from a dict
Merge pull request #2 from mapleoin/style

More style fixes