PermissionMapEditor, EdgeAttrList: Use list .clear() method.

Closes #110
This commit is contained in:
Chris PeBenito 2017-09-16 14:32:34 -04:00
parent d0ca705cc7
commit af88deac17
2 changed files with 2 additions and 6 deletions

View File

@ -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()
#

View File

@ -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"]