diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index 516921fc05..758b1eb66e 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -30,9 +30,11 @@ from zap_execution import ZapTool + def isWindows(): return platform.system() == "Windows" + # fcntl is not supported on widows platform due to lack of necessity of I/O control on file descriptor if not isWindows(): import fcntl @@ -343,7 +345,6 @@ def __enter__(self): self.lock_file = open(self.lock_file_path, 'wb') fcntl.lockf(self.lock_file, fcntl.LOCK_EX) - def __exit__(self, *args): # fcntl is not supported on widows platform due to lack of necessity of I/O control on file descriptor if not self.lock_file or isWindows():