Skip to content

Commit

Permalink
Make registry.Interface construction work with no standard_id.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
msdemlei committed Dec 15, 2023
1 parent 3c8c67f commit d24891a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyvo/registry/regtap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})")
Expand Down

0 comments on commit d24891a

Please sign in to comment.