diff --git a/conda_build/build.py b/conda_build/build.py index 4acb1bd9d9..74c7f03811 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -2760,7 +2760,10 @@ def build( # can be different from the env for the top level build. with utils.path_prepended(m.config.build_prefix): env = environ.get_dict(m=m) - pkg_type = "conda" if not hasattr(m, "type") else m.type + pkg_type = ( + getattr(m, "type", m.config.conda_pkg_format) + or CondaPkgFormat.V2 + ) newly_built_packages = bundlers[pkg_type]( output_d, m, env, stats, new_prefix_files ) diff --git a/news/5560-fix-pkg-type-key-error b/news/5560-fix-pkg-type-key-error new file mode 100644 index 0000000000..19ca33c226 --- /dev/null +++ b/news/5560-fix-pkg-type-key-error @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Fix `KeyError` when an inconsistent `build.pkg_type` value is specified in `meta.yaml`. (#5560) + +### Deprecations + +* + +### Docs + +* + +### Other + +*