factory: dict.keys() in py2 change to list(dict)

In python2, dict.keys() return a copy list of keys.
In python3, dict.keys() return an iterator of keys.

The semantic changes, so we need to use list(dict) to get a copy list.

BUG=chromium:999876
TEST=make test

Change-Id: Ic719a5cf08d448241d9f631fcb36103e73940a6b
Reviewed-on: https://chromium-review.googlesource.com/1824719
Tested-by: Yilin Yang <kerker@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Yong Hong <yhong@chromium.org>
diff --git a/py/utils/pygpt.py b/py/utils/pygpt.py
index 4c88f43..cda1564 100755
--- a/py/utils/pygpt.py
+++ b/py/utils/pygpt.py
@@ -1477,7 +1477,7 @@
         # Do not change any partitions with priority=0
         groups.pop(0)
 
-      prios = groups.keys()
+      prios = list(groups)
       prios.sort(reverse=True)
 
       # Max priority is 0xf.