From 1c269e9f4b35d2e7becab0b3e5d535fe9765ac5c Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 13 Mar 2021 15:52:41 +0000 Subject: [PATCH] Change darwin __raw_get() check for list to check it's not the OTHERS On darwin this comes back with the type `__NSCFArray`, which I can't find the definition of (in order to test against it). So instead let's check that `res` is not-None, and not one of `str` or `int`, because then it should be (meant to be) `list`. Yes, this is weird given the pre-rewrite code is: ```python def get(self, key: str) -> Union[None, list, str]: """Look up a string configuration value.""" val = self.settings.get(key) if val is None: return None elif isinstance(val, str): return str(val) elif isinstance(val, list): return list(val) # make writeable else: return None ``` But maybe something changed since 3.43 was tested and built. --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index c33ec421..50b0a41b 100644 --- a/config.py +++ b/config.py @@ -581,7 +581,7 @@ class MacConfig(AbstractConfig): def __raw_get(self, key: str) -> Union[None, list, str, int]: res = self._settings.get(key) - if isinstance(res, list): + if res and not isinstance(res, str) and not isinstance(res, int): return list(res) return res