diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-07-14 15:09:28 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-08-17 16:25:36 -0400 |
commit | 429e7c1edc7ef76b728b624dbd3b68834c253117 (patch) | |
tree | 81ee792887f60a37992d4363f333a52cfd3e7f3c /mesonbuild/interpreter/interpreter.py | |
parent | a78992dd81b4bd1673e4815ff26acd694ff77f68 (diff) | |
download | meson-429e7c1edc7ef76b728b624dbd3b68834c253117.zip meson-429e7c1edc7ef76b728b624dbd3b68834c253117.tar.gz meson-429e7c1edc7ef76b728b624dbd3b68834c253117.tar.bz2 |
interpreter: deprecate the ability import unstable modules as `unstable_*`
This was never meant to work, it's an implementation detail of using
`importlib.import_module` and that our modules used to be named
`unstable_` that this ever worked.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 9cf88d7..5752d4c 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -617,6 +617,9 @@ class Interpreter(InterpreterBase, HoldableObject): # Some tests use "unstable_" instead of "unstable-", and that happens to work because # of implementation details if modname.startswith(('unstable-', 'unstable_')): + if modname.startswith('unstable_'): + mlog.deprecation(f'Importing unstable modules as "{modname}" instead of "{modname.replace("_", "-", 1)}"', + location=node) real_modname = modname[len('unstable') + 1:] # + 1 to handle the - or _ expect_unstable = True else: |