Fix race condition when used concurrently

Open Tom Payne requested to merge twpayne/pyxdg:fix-concurrent-use into master

See See

If two instances of xdg are running concurrently and a directory does not exist, both will try to create it. The first will typically succeed, but the second will fail as the directory now exists.

This commit removes the race condition by allowing the directory to already exist after the isdir check.

Edited by Tom Payne

Merge request reports