🐛 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:
1 parent
3cf798120a
commit
74c2ce2054
1 file changed
+3
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user