make 'getObjectForUid' more tolerant

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3038 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-12-06 11:32:16 +00:00
parent 4697c0a22d
commit d86dd04830

View file

@ -89,7 +89,10 @@ def getObjectForUid(uid, intIds=None):
return None
if intIds is None:
intIds = component.getUtility(IIntIds)
return intIds.getObject(int(uid))
try:
return intIds.getObject(int(uid))
except KeyError:
return None
def getUidForObject(obj, intIds=None):
if obj == '*': # wild card