mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-22 02:56:31 +00:00
PermissionMapEditor, EdgeAttrList: Use list .clear() method.
Closes #110
This commit is contained in:
parent
d0ca705cc7
commit
af88deac17
@ -197,9 +197,7 @@ class EdgeAttrList(NetworkXGraphEdgeDescriptor):
|
||||
raise ValueError("{0} lists should not be assigned directly".format(self.name))
|
||||
|
||||
def __delete__(self, obj):
|
||||
# in Python3 a .clear() function was added for lists
|
||||
# keep this implementation for Python 2 compat
|
||||
del obj.G[obj.source][obj.target][self.name][:]
|
||||
obj.G[obj.source][obj.target][self.name].clear()
|
||||
|
||||
|
||||
#
|
||||
|
@ -138,9 +138,7 @@ class PermissionMapEditor(SEToolsWidget, QDialog):
|
||||
for mapping in self.widgets:
|
||||
mapping.close()
|
||||
|
||||
# in Python3 a .clear() function was added for lists
|
||||
# keep this implementation for Python 2 compat
|
||||
del self.widgets[:]
|
||||
self.widgets.clear()
|
||||
|
||||
|
||||
index_to_setting = ["r", "w", "b", "n"]
|
||||
|
Loading…
Reference in New Issue
Block a user