[FIX] base_suspend_security: Pretend to be a list of ints if neccessary

This commit is contained in:
Holger Brunn
2021-02-12 09:35:46 +01:00
parent e27ebb144c
commit f70b2f5ede
2 changed files with 30 additions and 0 deletions

View File

@@ -14,3 +14,16 @@ class BaseSuspendSecurityUid(int):
def __iter__(self):
yield super(BaseSuspendSecurityUid, self).__int__()
def __len__(self):
return 1
def __getitem__(self, key):
int_value = super().__int__()
if isinstance(key, slice):
if key.start > 0:
return ()
return (int_value,)
if key != 0:
raise IndexError
return int_value