diff options
author | Armando Montanez <amontanez@google.com> | 2023-10-20 22:36:54 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-10-20 22:36:54 +0000 |
commit | 3bad357764f0ce52a6820d0616b88f06ef81fee5 (patch) | |
tree | d6903a5e71f961e69010d1709d7cf88ff936e1fe /pw_build | |
parent | 2fa492e62d7b5a1ff0feef0f69d025b303eec148 (diff) | |
download | pigweed-3bad357764f0ce52a6820d0616b88f06ef81fee5.tar.gz |
pw_build: Silence Windows-specific warnings
Silences some Windows-specific pylint false positives.
Change-Id: I3ac85cd4e94a6b2aa7a0975718c43a41be8d5248
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/177172
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'pw_build')
-rwxr-xr-x | pw_build/py/pw_build/python_runner.py | 4 | ||||
-rw-r--r-- | pw_build/py/pw_build/wrap_ninja.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pw_build/py/pw_build/python_runner.py b/pw_build/py/pw_build/python_runner.py index 0923bb260..8fcdb2eaa 100755 --- a/pw_build/py/pw_build/python_runner.py +++ b/pw_build/py/pw_build/python_runner.py @@ -150,8 +150,10 @@ def acquire_lock(lockfile: Path, exclusive: bool): start_time = time.monotonic() if exclusive: + # pylint: disable-next=used-before-assignment lock_type = fcntl.LOCK_EX # type: ignore[name-defined] else: + # pylint: disable-next=used-before-assignment lock_type = fcntl.LOCK_SH # type: ignore[name-defined] fd = os.open(lockfile, os.O_RDWR | os.O_CREAT) @@ -165,9 +167,11 @@ def acquire_lock(lockfile: Path, exclusive: bool): backoff = 1 while time.monotonic() - start_time < _LOCK_ACQUISITION_TIMEOUT: try: + # pylint: disable=used-before-assignment fcntl.flock( # type: ignore[name-defined] fd, lock_type | fcntl.LOCK_NB # type: ignore[name-defined] ) + # pylint: enable=used-before-assignment return # Lock acquired! except BlockingIOError: pass # Keep waiting. diff --git a/pw_build/py/pw_build/wrap_ninja.py b/pw_build/py/pw_build/wrap_ninja.py index e7a0f4911..56d37f740 100644 --- a/pw_build/py/pw_build/wrap_ninja.py +++ b/pw_build/py/pw_build/wrap_ninja.py @@ -249,7 +249,7 @@ class Ninja: self.lock = threading.Lock() # Launch ninja and configure pseudo-tty. - # pylint: disable-next=no-member,undefined-variable + # pylint: disable-next=no-member,undefined-variable,used-before-assignment ptty_parent, ptty_child = pty.openpty() # type: ignore ptty_file = os.fdopen(ptty_parent, 'r') env = dict(os.environ) |