From 8f207ff26c8beea9efeb7d71f5a3efdbf888297c Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 19 Sep 2017 22:36:08 +0300 Subject: [PATCH] module: fix applicability --- pygnulib/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygnulib/module.py b/pygnulib/module.py index 6f19178963..2d06e889da 100644 --- a/pygnulib/module.py +++ b/pygnulib/module.py @@ -130,11 +130,14 @@ class Base: def applicability(self): """applicability (usually "main" or "tests")""" default = "main" if self.name.endswith("-tests") else "tests" - return self.__table.get("applicability", default) + result = self.__table.get("applicability") + return result if result else default @applicability.setter def applicability(self, value): _type_assert_("applicability", value, str) + if value not in ("all", "main", "tests"): + raise ValueError("applicability: \"main\", \"tests\" or \"all\"") self.__table["applicability"] = value -- 2.39.5