Skip to content

Commit 6874422

Browse files
author
Alexander Smishlajev
committed
Class.get(): return default if rdbms value is None (i.e. unset).
fixes testFileClassReindexing for sqlite and probably other sql backends.
1 parent 99a2a60 commit 6874422

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

roundup/backends/rdbms_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.128 2004-07-28 05:00:32 richard Exp $
1+
# $Id: rdbms_common.py,v 1.129 2004-09-26 14:03:49 a1s Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1434,7 +1434,9 @@ def get(self, nodeid, propname, default=_marker, cache=1):
14341434
# get the property (raises KeyErorr if invalid)
14351435
prop = self.properties[propname]
14361436

1437-
if not d.has_key(propname):
1437+
# XXX may it be that propname is valid property name
1438+
# (above error is not raised) and not d.has_key(propname)???
1439+
if (not d.has_key(propname)) or (d[propname] is None):
14381440
if default is self._marker:
14391441
if isinstance(prop, Multilink):
14401442
return []

0 commit comments

Comments
 (0)