diff --git a/news/py_zipapp_runtime_files.fixed.md b/news/py_zipapp_runtime_files.fixed.md new file mode 100644 index 0000000000..bc1343c1da --- /dev/null +++ b/news/py_zipapp_runtime_files.fixed.md @@ -0,0 +1,2 @@ +(zipapp) Fixed handling of {obj}`PyRuntimeInfo` with `files = None` so creating +zipapp archives does not error. diff --git a/python/private/zipapp/py_zipapp_rule.bzl b/python/private/zipapp/py_zipapp_rule.bzl index b1a9399e90..7e11b06b1b 100644 --- a/python/private/zipapp/py_zipapp_rule.bzl +++ b/python/private/zipapp/py_zipapp_rule.bzl @@ -133,7 +133,8 @@ def _create_zip(ctx, py_runtime, py_executable, stage2_bootstrap): runfiles = builders.RunfilesBuilder() - runfiles.add(py_runtime.files) + if py_runtime.files != None: + runfiles.add(py_runtime.files) if py_executable.venv_python_exe: runfiles.add(py_executable.venv_python_exe)