Fix FileNotFoundError to be compatible with older python versions