🐛 Use isinstance instead of type

https://github.com/OctoPrint/OctoPrint/pull/3866#pullrequestreview-549218212

'Better use isinstance(exclude, list) here, or we rule out anything that inherits from list.'

This is also consistent with the method further down the call, at https://github.com/OctoPrint/OctoPrint/blob/280baee3a0f299366daa303ab23a1379405ebd0d/src/octoprint/plugins/backup/__init__.py#L876-L879
This commit is contained in:
cp2004 committed 2020-12-27 16:18:23 +00:00
1 parent 3cf798120a
commit 74c2ce2054
1 file changed
+3 -1
+3 -1
View File
@@ -400,8 +400,10 @@ class BackupPlugin(
Args:
exclude (list): Identifiers of data folders to exclude
"""
if exclude is None or not (type(exclude) == list):
if exclude is None:
exclude = []
if not isinstance(exclude, list):
exclude = list(exclude)
self._start_backup(exclude, filename=filename)
return filename