Skip to content

Commit fe050e2

Browse files
author
Richard Jones
committed
nicer error message
1 parent 6e6ad2e commit fe050e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

roundup/backends/back_anydbm.py

Lines changed: 2 additions & 2 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.75 2002-09-10 12:44:42 richard Exp $
18+
#$Id: back_anydbm.py,v 1.76 2002-09-12 05:51:42 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -1354,7 +1354,7 @@ def lookup(self, keyvalue):
13541354
otherwise a KeyError is raised.
13551355
'''
13561356
if not self.key:
1357-
raise TypeError, 'No key property set'
1357+
raise TypeError, 'No key property set for class %s'%self.classname
13581358
cldb = self.db.getclassdb(self.classname)
13591359
try:
13601360
for nodeid in self.db.getnodeids(self.classname, cldb):

roundup/backends/back_gadfly.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_gadfly.py,v 1.16 2002-09-11 01:20:09 richard Exp $
1+
# $Id: back_gadfly.py,v 1.17 2002-09-12 05:51:42 richard Exp $
22
__doc__ = '''
33
About Gadfly
44
============
@@ -1409,7 +1409,7 @@ def lookup(self, keyvalue):
14091409
otherwise a KeyError is raised.
14101410
'''
14111411
if not self.key:
1412-
raise TypeError, 'No key property set'
1412+
raise TypeError, 'No key property set for class %s'%self.classname
14131413

14141414
cursor = self.db.conn.cursor()
14151415
sql = 'select id from _%s where _%s=?'%(self.classname, self.key)

0 commit comments

Comments
 (0)