zbyszek / rpms / PyGreSQL

Forked from rpms/PyGreSQL 6 years ago
Clone
1b67c85
From 7fe2cc4d84d37e29f256fd8f614861121a2da254 Mon Sep 17 00:00:00 2001
1b67c85
From: Christoph Zwerschke <cito@online.de>
1b67c85
Date: Fri, 6 Jan 2017 16:36:05 +0000
1b67c85
Subject: [PATCH] Fix an issue with Python 3.6
1b67c85
1b67c85
While running over a dictionary in a for loop, we altered its values.
1b67c85
This used to work perfectly well in Python before 3.6, but now causes
1b67c85
problems, probably due to internal optimizations. We avoid this now.
1b67c85
---
1b67c85
 pg.py | 2 +-
1b67c85
 1 file changed, 1 insertion(+), 1 deletion(-)
1b67c85
1b67c85
diff --git a/pg.py b/pg.py
1b67c85
index 117e440..5942d50 100644
1b67c85
--- a/pg.py
1b67c85
+++ b/pg.py
1b67c85
@@ -708,7 +708,7 @@ class Adapter:
1b67c85
             # so we first must find the values actually used in the command
1b67c85
             used_values = {}
1b67c85
             literals = dict.fromkeys(values, '')
1b67c85
-            for key in literals:
1b67c85
+            for key in values:
1b67c85
                 del literals[key]
1b67c85
                 try:
1b67c85
                     command % literals
1b67c85
-- 
1b67c85
2.9.3
1b67c85