Typo and indentation corrections. One more resource warning.
Unify three checks for a file being changed into one function. Note that python < 3.3 raise IOError if a file is not found, while python >= 3.3 raise FileNotFound, a kind of OSError. EnvironmentError is a common superclass on all versions and in fact is where `errno` is defined.