Browse Source

Py3 compat changes for diff view

With keys being a view we need to convert it to a list explicitly now.

Change-Id: I99b5279d98b6d79bcf6e891040877d7b89bbcf7c
Clint Byrum 1 year ago
parent
commit
158d161cba
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      gertty/view/diff.py

+ 5
- 3
gertty/view/diff.py View File

@@ -324,11 +324,13 @@ class BaseDiffView(urwid.WidgetWrap, mywid.Searchable):
324 324
         # Handle comments that landed outside our default diff context
325 325
         lastlen = 0
326 326
         while comment_lists:
327
-            if len(comment_lists.keys()) == lastlen:
327
+            comment_lists_keys = list(comment_lists.keys())
328
+            if len(comment_lists_keys) == lastlen:
328 329
                 self.log.error("Unable to display all comments: %s" % comment_lists)
329 330
                 return
330
-            lastlen = len(comment_lists.keys())
331
-            key = comment_lists.keys()[0]
331
+            comment_lists_keys = list(comment_lists.keys())
332
+            lastlen = len(comment_lists_keys)
333
+            key = comment_lists_keys[0]
332 334
             kind, lineno, path = key.split('-', 2)
333 335
             lineno = int(lineno)
334 336
             if kind.startswith('old'):

Loading…
Cancel
Save