File: 0002-fix-dict-order-py38-incompatibility.patch

package info (click to toggle)
sosreport 4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,800 kB
  • sloc: python: 20,375; sh: 166; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 771 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Fix dict order incompability
 Fix dictionary keys changed during iteration.
Author: Eric Desrochers <eric.desrochers@canonical.com>
Origin: upstream, https://github.com/sosreport/sos/commit/1d7bab6c7
Bug: https://github.com/sosreport/sos/issues/2206
--- sos-4.0.orig/sos/options.py
+++ sos-4.0/sos/options.py
@@ -186,7 +186,7 @@ class SoSOptions():
                 if 'verbose' in odict.keys():
                     odict['verbosity'] = int(odict.pop('verbose'))
                 # convert options names
-                for key in odict.keys():
+                for key in list(odict):
                     if '-' in key:
                         odict[key.replace('-', '_')] = odict.pop(key)
                 # set the values according to the config file