py23 compat: list is needed not a view
in py3 keys() returns a view but in this cases we need a list
This commit is contained in:
1 parent
f72f948744
commit
ff0b94c78d
4 files changed
+4
-4
No files matched your search
@@ -498,7 +498,7 @@ class PluginSettings(object):
|
||||
self.settings.remove(self._prefix_path())
|
||||
|
||||
def __getattr__(self, item):
|
||||
all_access_methods = self.access_methods.keys() + self.deprecated_access_methods.keys()
|
||||
all_access_methods = list(self.access_methods.keys()) + list(self.deprecated_access_methods.keys())
|
||||
if item in all_access_methods:
|
||||
decorator = None
|
||||
if item in self.deprecated_access_methods:
|
||||
|
||||
@@ -892,7 +892,7 @@ class PluginManager(object):
|
||||
incl_all_found=True)
|
||||
|
||||
# let's clean everything we DIDN'T find first
|
||||
removed = [key for key in self.enabled_plugins.keys() + self.disabled_plugins.keys() if key not in found]
|
||||
removed = [key for key in list(self.enabled_plugins.keys()) + list(self.disabled_plugins.keys()) if key not in found]
|
||||
for key in removed:
|
||||
try:
|
||||
del self.enabled_plugins[key]
|
||||
|
||||
@@ -675,7 +675,7 @@ def dict_minimal_mergediff(source, target):
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
all_keys = set(source.keys() + target.keys())
|
||||
all_keys = set(list(source.keys()) + list(target.keys()))
|
||||
result = dict()
|
||||
for k in all_keys:
|
||||
if k not in target:
|
||||
|
||||
@@ -174,7 +174,7 @@ class PluginTestCase(unittest.TestCase):
|
||||
def test_sorted_hooks(self):
|
||||
hooks = self.plugin_manager.get_hooks("some.ordered.callback")
|
||||
self.assertEqual(3, len(hooks))
|
||||
self.assertListEqual(["one_ordered_hook_plugin", "another_ordered_hook_plugin", "hook_plugin"], hooks.keys())
|
||||
self.assertListEqual(["one_ordered_hook_plugin", "another_ordered_hook_plugin", "hook_plugin"], list(hooks.keys()))
|
||||
|
||||
def test_get_implementations(self):
|
||||
implementations = self.plugin_manager.get_implementations(octoprint.plugin.StartupPlugin)
|
||||
|
||||
Reference in new issue
Block a user