Generalize patch to all platform integrating smontanaro/pylockfile@fe31f0c6