core: chroot: make ChrootType membership check work on python 3.10 (MR 2471)

You can't check enum membership with __contains__() on Python 3.10, poke
inside the enum instead.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-11-02 17:41:14 +01:00 committed by Oliver Smith
parent 3592f9a285
commit 7e7057042f
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -50,7 +50,7 @@ class Chroot:
"riscv64", "riscv64",
] ]
if self.__type not in ChrootType: if self.__type not in ChrootType._member_map_.values():
raise ValueError(f"Invalid chroot type: '{self.__type}'") raise ValueError(f"Invalid chroot type: '{self.__type}'")
# A buildroot suffix must have a name matching one of alpines # A buildroot suffix must have a name matching one of alpines