MAINT: Fix LGTM.com warning: File is not always closed
MAINT: Fix LGTM.com warning: File is not always closed

File may not be closed if an exception is raised.

numpy/numpy,endolith/numpy,endolith/numpy,rgommers/numpy,mhvk/numpy,mhvk/numpy,seberg/numpy,anntzer/numpy,numpy/numpy,jakirkham/numpy,mhvk/numpy,jakirkham/numpy,mhvk/numpy,seberg/numpy,seberg/numpy,charris/numpy,rgommers/numpy,anntzer/numpy,mattip/numpy,pdebuyl/numpy,jakirkham/numpy,jakirkham/numpy,pdebuyl/numpy,seberg/numpy,mattip/numpy,pdebuyl/numpy,numpy/numpy,mhvk/numpy,charris/numpy,rgommers/numpy,pdebuyl/numpy,endolith/numpy,charris/numpy,charris/numpy,anntzer/numpy,endolith/numpy,mattip/numpy,jakirkham/numpy,anntzer/numpy,rgommers/numpy,mattip/numpy,numpy/numpy