From b2970d4bbee576c7f454efa2faf810706cb77c50 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 16 Aug 2024 17:24:28 +0200 Subject: [PATCH] pySim.esim.saip.oid: Allow OID instance in prefix_match() So far the prefix_match() required a string argument; let's also permit another OID object to be passed; we internally convert that to string. Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a --- pySim/esim/saip/oid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pySim/esim/saip/oid.py b/pySim/esim/saip/oid.py index f201ffee..02ef23bd 100644 --- a/pySim/esim/saip/oid.py +++ b/pySim/esim/saip/oid.py @@ -77,9 +77,9 @@ class OID: if self.cmp(other) > 0: return True - def prefix_match(self, oid_str): + def prefix_match(self, oid_str: Union[str, 'OID']): """determine if oid_str is equal or below our OID.""" - return oid_str.startswith(str(self)) + return str(oid_str).startswith(str(self)) class eOID(OID):