[ZPT] CVS: Releases/Zope/lib/python/ZTUtils - Batch.py:1.5
Evan Simpson
evan@zope.com
Tue, 13 Nov 2001 14:23:55 -0500
Update of /cvs-repository/Releases/Zope/lib/python/ZTUtils
In directory cvs.zope.org:/tmp/cvs-serv22522
Modified Files:
Batch.py
Log Message:
Only catch IndexError when testing sequence bounds.
=== Releases/Zope/lib/python/ZTUtils/Batch.py 1.4 => 1.5 ===
try: sequence[start-1]
- except: start=len(sequence)
+ except IndexError: start=len(sequence)
if end > 0:
if end < start: end=start
else:
end=start+size-1
try: sequence[end+orphan-1]
- except: end=len(sequence)
+ except IndexError: end=len(sequence)
elif end > 0:
try: sequence[end-1]
- except: end=len(sequence)
+ except IndexError: end=len(sequence)
start=end+1-size
if start - 1 < orphan: start=1
else:
start=1
end=start+size-1
try: sequence[end+orphan-1]
- except: end=len(sequence)
+ except IndexError: end=len(sequence)
return start,end,size