summaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-08-30 11:12:57 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commit177148686c8c207268619d2d58ee021b1d6fd082 (patch)
tree1cdf774e17613f906950f3a7d43dd037849e9950 /mesonbuild/mintro.py
parent164a18d84f4543669e5cab75490ff3629aa961d4 (diff)
downloadmeson-177148686c8c207268619d2d58ee021b1d6fd082.tar.gz
options: split UserIntegerOption and UserUmaskOption
They are very similar, but they are not exactly the same. By splitting them we can get full type safety, and run mypy over the options.py file!
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index cf76b6012..4b65c5aca 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -317,7 +317,7 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s
elif isinstance(opt, options.UserComboOption):
optdict['choices'] = opt.printable_choices()
typestr = 'combo'
- elif isinstance(opt, options.UserIntegerOption):
+ elif isinstance(opt, (options.UserIntegerOption, options.UserUmaskOption)):
typestr = 'integer'
elif isinstance(opt, options.UserStringArrayOption):
typestr = 'array'
@@ -325,7 +325,7 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s
if c:
optdict['choices'] = c
else:
- raise RuntimeError("Unknown option type")
+ raise RuntimeError('Unknown option type: ', repr(type(opt)))
optdict['type'] = typestr
optdict['description'] = opt.description
optlist.append(optdict)