diff --git a/pylib/tests/run_format.py b/pylib/tests/run_format.py index fa9658c17..ceaa67bc5 100644 --- a/pylib/tests/run_format.py +++ b/pylib/tests/run_format.py @@ -1,7 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import fcntl import os import subprocess import sys @@ -12,6 +11,8 @@ if __name__ == "__main__": fix = len(sys.argv) > 2 if sys.platform == "linux": + import fcntl + file = open("/tmp/anki-black", "w") fcntl.lockf(file, fcntl.LOCK_EX) diff --git a/qt/tests/run_format.py b/qt/tests/run_format.py index a4a34d048..79590a68b 100644 --- a/qt/tests/run_format.py +++ b/qt/tests/run_format.py @@ -1,7 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import fcntl import os import subprocess import sys @@ -12,6 +11,8 @@ if __name__ == "__main__": fix = len(sys.argv) > 2 if sys.platform == "linux": + import fcntl + file = open("/tmp/anki-black", "w") fcntl.lockf(file, fcntl.LOCK_EX)