From 4722e1f6a0c5978617de52e1ec4611e5d6067142 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 3 Feb 2015 00:22:10 +0100 Subject: Use method pop to remove item from dict --- module/plugins/container/LinkList.py | 2 +- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py index cff1b9915..86c5f88e7 100644 --- a/module/plugins/container/LinkList.py +++ b/module/plugins/container/LinkList.py @@ -63,7 +63,7 @@ class LinkList(Container): delete.append(key) for key in delete: - del packages[key] + packages.pop(key, None) if self.getConfig("clear"): try: diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 9435d35d9..a1ee7f5ef 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -112,11 +112,11 @@ class XFileSharingPro(Hook): hdict = self.core.pluginManager.hosterPlugins[hoster] if "new_name" in hdict and hdict['new_name'] == "XFileSharingPro": if "module" in hdict: - del hdict['module'] + hdict.pop('module', None) if "new_module" in hdict: - del hdict['new_module'] - del hdict['new_name'] + hdict.pop('new_module', None) + hdict.pop('new_name', None) return True else: -- cgit v1.2.3