sk- / git-lint

improving source code one step at a time
Apache License 2.0
236 stars 78 forks source link

Fixes #117 `utilities.py:_open_for_write` no longer has a race condition #118

Closed rawrgulmuffins closed 6 years ago

rawrgulmuffins commented 6 years ago

Fixes #117

Changes

NOTE

Normally I'd write a unit test for this kind of change. If we were using threads I would write the test by injecting a conditional lock into the main thread after the if os.exists check.

I don't know how to do that with multiprocess. If you know how that can be accomplished I'd love to include that test.

rawrgulmuffins commented 6 years ago

Switching over to Pathlib2 solution for this issue.