api: make enforce() static

It doesn't use 'self'. And pylint complains.
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-29 20:22:35 +01:00
parent db6094f397
commit 3740e2d48b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -196,7 +196,8 @@ class AbstractQubesAPI(object):
return apply_filters(iterable,
self.fire_event_for_permission(**kwargs))
def enforce(self, predicate):
@staticmethod
def enforce(predicate):
'''An assert replacement, but works even with optimisations.'''
if not predicate:
raise PermissionDenied()