mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-23 11:36:30 +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))
|
raise ValueError("{0} lists should not be assigned directly".format(self.name))
|
||||||
|
|
||||||
def __delete__(self, obj):
|
def __delete__(self, obj):
|
||||||
# in Python3 a .clear() function was added for lists
|
obj.G[obj.source][obj.target][self.name].clear()
|
||||||
# keep this implementation for Python 2 compat
|
|
||||||
del obj.G[obj.source][obj.target][self.name][:]
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -138,9 +138,7 @@ class PermissionMapEditor(SEToolsWidget, QDialog):
|
|||||||
for mapping in self.widgets:
|
for mapping in self.widgets:
|
||||||
mapping.close()
|
mapping.close()
|
||||||
|
|
||||||
# in Python3 a .clear() function was added for lists
|
self.widgets.clear()
|
||||||
# keep this implementation for Python 2 compat
|
|
||||||
del self.widgets[:]
|
|
||||||
|
|
||||||
|
|
||||||
index_to_setting = ["r", "w", "b", "n"]
|
index_to_setting = ["r", "w", "b", "n"]
|
||||||
|
Loading…
Reference in New Issue
Block a user