peteboyd / lammps_interface

automatic generation of LAMMPS input files for molecular dynamics simulations of MOFs
MIT License
125 stars 63 forks source link

don't leave dir unchanged in case of error #9

Closed paulboone closed 6 years ago

paulboone commented 6 years ago

The except block will get triggered every time somebody installs this directly using pip, and that leaves the current directly in a dirty state, which breaks any code that assumes the cwd is in the current directory.

This fix just ensures that the current working dir is unchanged, regardless of what happens.

A good way of handling versions that avoids all this trouble (and works in all cases, including when the app is installed from a tarball) is to use python-versioneer: https://github.com/warner/python-versioneer.

peteboyd commented 6 years ago

Cheers thanks Paul!