This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import errno | |
import fcntl | |
from pathlib import Path | |
def lock_script() -> bool: | |
""" | |
Locks a file pertaining to this script so that it cannot be run simultaneously. | |
Since the lock is automatically released when this script ends, there is no | |
need for an unlock function for this use case. |