techtonik / python-patch

Library to parse and apply unified diffs
https://pypi.python.org/pypi/patch
106 stars 63 forks source link

PatchSet apply will not restore directory in case of failure #56

Open stefanoborini opened 5 years ago

stefanoborini commented 5 years ago

PatchSet.apply needs a context manager to restore the prevdir cwd in case of exception. As it is now, the path remains the new root, which may be puzzling.