From: Stefano Rivera <stefanor@debian.org>
Date: Tue, 11 Jan 2022 16:45:11 -0400
Subject: Debian: Instruct the user to install the appropriate -whl package

Forwarded: not-needed
---
 src/virtualenv/seed/wheels/embed/__init__.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py
index 77d16e7..5eed57e 100644
--- a/src/virtualenv/seed/wheels/embed/__init__.py
+++ b/src/virtualenv/seed/wheels/embed/__init__.py
@@ -77,6 +77,20 @@ def get_embed_wheel(distribution: str, for_py_version: str | None) -> Wheel | No
     :raises RuntimeError: if the bundled wheel on disk fails SHA-256 verification.
 
     """
+    # Debian specific: Point at the appropriate wheel package
+    wheel = BUNDLE_SUPPORT.get(for_py_version, {}).get(distribution)
+    if wheel is None:
+        raise Exception((
+                "Wheel for {} for Python {} is unavailable. "
+                "apt install python{}-{}-whl"
+            ).format(
+                distribution,
+                for_py_version,
+                '2' if for_py_version == '2.7' else '3',
+                distribution,
+            ))
+    # End Debian specific
+
     if for_py_version is None or _release_tuple(for_py_version) > _release_tuple(MAX):
         # no specific target, or a Python newer than anything bundled: reuse the newest bundle
         mapping = BUNDLE_SUPPORT[MAX]
