summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-09-30 11:27:54 -0700
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-10-04 17:18:54 +0300
commitab7684d8af64c10a1f15978dc7ee7e2b40ab7dcd (patch)
treeae723da3d7f68a9305ca817029ba80e4b4d8f1d8 /mesonbuild
parenta48deaf9df49c999eeeb0820021acde942176860 (diff)
downloadmeson-ab7684d8af64c10a1f15978dc7ee7e2b40ab7dcd.tar.gz
utils/platform: Use a type declaration instead of default value
We don't want to have an `Optional` type here, we just want to tell mypy that the value will be a FileLike object.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/utils/platform.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/utils/platform.py b/mesonbuild/utils/platform.py
index 538c10890..1a2780f26 100644
--- a/mesonbuild/utils/platform.py
+++ b/mesonbuild/utils/platform.py
@@ -22,13 +22,15 @@ class DirectoryLockAction(enum.Enum):
FAIL = 2
class DirectoryLockBase:
+
+ lockfile: T.TextIO
+
def __init__(self, directory: str, lockfile: str, action: DirectoryLockAction, err: str,
optional: bool = False) -> None:
self.action = action
self.err = err
self.lockpath = os.path.join(directory, lockfile)
self.optional = optional
- self.lockfile: T.Optional[T.TextIO] = None
def __enter__(self) -> None:
mlog.debug('Calling the no-op version of DirectoryLock')