Change code to use copy().

This commit is contained in:
Friedrich Lindenberg 2013-12-04 17:55:42 +01:00
parent ff247f17cc
commit a174225de3

View File

@ -1,4 +1,5 @@
import logging import logging
import copy
from itertools import count from itertools import count
from sqlalchemy.sql import and_, expression from sqlalchemy.sql import and_, expression
@ -130,10 +131,10 @@ class Table(object):
self._ensure_columns(row, types=types) self._ensure_columns(row, types=types)
# Don't update the key itself, so remove any keys from the row dict # Don't update the key itself, so remove any keys from the row dict
clean_row = {} clean_row = copy.copy(row)
for key, value in row.items(): for key in keys:
if key not in keys: if key in clean_row.keys():
clean_row[key] = value del clean_row[key]
try: try:
filters = self._args_to_clause(dict(clause)) filters = self._args_to_clause(dict(clause))