aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-09 15:18:49 -0700
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-08-20 18:57:19 +0200
commit0f5f265a1677e7492c9bc1d6e1505a9f493bf847 (patch)
tree0ebaf173692813039999b20523c8774751f62fda /mesonbuild/mesonlib
parenta5c4cf3a3f74262994dffcc1238843882b13cf8f (diff)
downloadmeson-0f5f265a1677e7492c9bc1d6e1505a9f493bf847.zip
meson-0f5f265a1677e7492c9bc1d6e1505a9f493bf847.tar.gz
meson-0f5f265a1677e7492c9bc1d6e1505a9f493bf847.tar.bz2
mesonlib: Add an exception for what should be unreachable code
It gives us a little more saftey, and makes pylance happy.
Diffstat (limited to 'mesonbuild/mesonlib')
-rw-r--r--mesonbuild/mesonlib/universal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py
index 54d6c37..e7244af 100644
--- a/mesonbuild/mesonlib/universal.py
+++ b/mesonbuild/mesonlib/universal.py
@@ -1260,6 +1260,8 @@ def dump_conf_header(ofilename: str, cdata: 'ConfigurationData', output_format:
elif output_format == 'nasm':
prelude = CONF_NASM_PRELUDE
prefix = '%'
+ else:
+ raise MesonBugException(f'Undefined output_format: "{output_format}"')
ofilename_tmp = ofilename + '~'
with open(ofilename_tmp, 'w', encoding='utf-8') as ofile: