modify try except to open file

In setup.py handle open files too complicated.