Skip to content

Commit ce8f1d7

Browse files
author
Richard Jones
committed
don't modify in-place
1 parent 767628b commit ce8f1d7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

roundup/backends/back_anydbm.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.146.2.23 2004-11-25 23:46:21 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.24 2004-12-14 22:59:53 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -2043,24 +2043,25 @@ def export_journals(self):
20432043
for nodeid, date, user, action, params in self.history(nodeid):
20442044
date = date.get_tuple()
20452045
if action == 'set':
2046+
export_data = {}
20462047
for propname, value in params.items():
20472048
if not properties.has_key(propname):
20482049
# property no longer in the schema
2049-
del params[propname]
20502050
continue
20512051

20522052
prop = properties[propname]
20532053
# make sure the params are eval()'able
20542054
if value is None:
2055-
pass
2055+
# don't export empties
2056+
continue
20562057
elif isinstance(prop, Date):
20572058
value = value.get_tuple()
20582059
elif isinstance(prop, Interval):
20592060
value = value.get_tuple()
20602061
elif isinstance(prop, Password):
20612062
value = str(value)
2062-
params[propname] = value
2063-
l = [nodeid, date, user, action, params]
2063+
export_data[propname] = value
2064+
l = [nodeid, date, user, action, export_data]
20642065
r.append(map(repr, l))
20652066
return r
20662067

0 commit comments

Comments
 (0)