♻️ Py3: Remove past.builtins and future.utils uses
This commit is contained in:
1 parent
292aa99543
commit
e45e97f9ac
24 files changed
+83
-130
No files matched your search
@@ -21,7 +21,6 @@ import requests
|
||||
import sarge
|
||||
from flask import jsonify, make_response
|
||||
from flask_babel import gettext
|
||||
from past.builtins import basestring
|
||||
|
||||
import octoprint.plugin
|
||||
import octoprint.plugin.core
|
||||
@@ -81,7 +80,7 @@ def map_repository_entry(entry):
|
||||
if (
|
||||
"python" in entry["compatibility"]
|
||||
and entry["compatibility"]["python"] is not None
|
||||
and isinstance(entry["compatibility"]["python"], basestring)
|
||||
and isinstance(entry["compatibility"]["python"], str)
|
||||
):
|
||||
result["is_compatible"]["python"] = is_python_compatible(
|
||||
entry["compatibility"]["python"]
|
||||
@@ -1143,7 +1142,7 @@ class PluginManagerPlugin(
|
||||
result_notifications=True,
|
||||
settings_save=True,
|
||||
):
|
||||
if isinstance(plugin, basestring):
|
||||
if isinstance(plugin, str):
|
||||
key = result_value = plugin
|
||||
else:
|
||||
key = plugin.key
|
||||
@@ -1720,9 +1719,7 @@ class PluginManagerPlugin(
|
||||
try:
|
||||
result = hook()
|
||||
if isinstance(result, (list, tuple)):
|
||||
reconnect_hooks.extend(
|
||||
filter(lambda x: isinstance(x, basestring), result)
|
||||
)
|
||||
reconnect_hooks.extend(filter(lambda x: isinstance(x, str), result))
|
||||
except Exception:
|
||||
self._logger.exception(
|
||||
"Error while retrieving additional hooks for which a "
|
||||
|
||||
Reference in new issue
Block a user