You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

  1. From d84109f0b60096ce71cd0537b31b69a7f5ea8756 Mon Sep 17 00:00:00 2001
  2. From: Flavio Leitner <fbl@sysclose.org>
  3. Date: Sat, 14 Sep 2019 20:17:28 -0300
  4. Subject: [PATCH] ovsdb-idlc.in: fix dict change during iteration.
  5. Python3 complains if a dict key is changed during the
  6. iteration.
  7. Use list() to create a copy of it.
  8. Traceback (most recent call last):
  9. File "./ovsdb/ovsdb-idlc.in", line 1581, in <module>
  10. func(*args[1:])
  11. File "./ovsdb/ovsdb-idlc.in", line 185, in printCIDLHeader
  12. replace_cplusplus_keyword(schema)
  13. File "./ovsdb/ovsdb-idlc.in", line 179, in replace_cplusplus_keyword
  14. for columnName in table.columns:
  15. RuntimeError: dictionary keys changed during iteration
  16. Signed-off-by: Flavio Leitner <fbl@sysclose.org>
  17. Signed-off-by: Ben Pfaff <blp@ovn.org>
  18. ---
  19. ovsdb/ovsdb-idlc.in | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
  22. index 40fef39edf..22d0a4e22e 100755
  23. --- a/ovsdb/ovsdb-idlc.in
  24. +++ b/ovsdb/ovsdb-idlc.in
  25. @@ -176,7 +176,7 @@ def replace_cplusplus_keyword(schema):
  26. 'wchar_t', 'while', 'xor', 'xor_eq'}
  27. for tableName, table in schema.tables.items():
  28. - for columnName in table.columns:
  29. + for columnName in list(table.columns):
  30. if columnName in keywords:
  31. table.columns[columnName + '_'] = table.columns.pop(columnName)