From d24891a58599dc187f36b9336858d76c2a02eaac Mon Sep 17 00:00:00 2001 From: Markus Demleitner Date: Fri, 15 Dec 2023 15:09:10 +0100 Subject: [PATCH] Make registry.Interface construction work with no standard_id. Interface.__init__ so far tries a .startswith on something that can be None (actually, will be by virtue of the preceding line). This commit fixes this. --- pyvo/registry/regtap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyvo/registry/regtap.py b/pyvo/registry/regtap.py index 86d6ad31c..af28187ee 100644 --- a/pyvo/registry/regtap.py +++ b/pyvo/registry/regtap.py @@ -348,11 +348,15 @@ class Interface: def __init__(self, access_url, standard_id, intf_type, intf_role): self.access_url = access_url self.standard_id = standard_id or None - self.is_vosi = standard_id.startswith("ivo://ivoa.net/std/vosi") self.type = intf_type or None self.role = intf_role or None self.is_standard = self.role == "std" + if self.standard_id is not None: + self.is_vosi = self.standard_id.startswith("ivo://ivoa.net/std/vosi") + else: + self.is_vosi = False + def __repr__(self): return (f"Interface({self.access_url!r}, {self.standard_id!r}," f" {self.type!r}, {self.role!r})")