Did you actually experience this happening or are you just being defensive since it’s technically possible?
> # HG changeset patch
> # User Christopher Hoover <ch@murgatroid.com>
> # Date 1510451669 28800
> # Sat Nov 11 17:54:29 2017 -0800
> # Node ID daba4a5f7acefe52f5fa4f036c9df59865c8df1e Same for this one.
> # Parent 0e0470d3e892bfd4818bfb972b8b85d58f2b00d4
> Fixes case where column order setting parsing was calling split on None.
>
> diff -r 0e0470d3e892 -r daba4a5f7ace chirp/ui/memedit.py
> --- a/chirp/ui/memedit.py Fri Nov 03 20:24:29 2017 -0400
> +++ b/chirp/ui/memedit.py Sat Nov 11 17:54:29 2017 -0800
> @@ -961,15 +961,19 @@
>
> default_col_order = [x for x, y, z in self.cols if z]
> try:
> - col_order = self._config.get("column_order_%s" % Did you actually experience this happening or are you just being defensive since it’s technically possible?
> - self.__class__.__name__).split(",")
> - if len(col_order) != len(default_col_order):
> - raise Exception()
> - for i in col_order:
> - if i not in default_col_order:
> + config_setting = self._config.get("column_order_%s" %
> + self.__class__.__name__)
> + if config_setting is None:
> + col_order = default_col_order
> + else:
> + col_order = config_setting.split(",")
> + if len(col_order) != len(default_col_order):
> raise Exception()
> + for i in col_order:
> + if i not in default_col_order:
> + raise Exception()
One other way to do this would be to just make it:
for i in col_order or default_col_order:
Thus avoiding the extra conditional and indent. But, that’s just a nit.
Thanks!
—Dan