[Zope-CVS] CVS: Products/ZCTextIndex/tests - mhindex.py:1.1.2.2
Guido van Rossum
guido@python.org
Tue, 14 May 2002 10:38:13 -0400
Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv966
Modified Files:
Tag: TextIndexDS9-branch
mhindex.py
Log Message:
Report full tracebacks.
Use OkapiIndex.
=== Products/ZCTextIndex/tests/mhindex.py 1.1.2.1 => 1.1.2.2 ===
import mhlib
import getopt
+import traceback
from StringIO import StringIO
DATAFS = "/home/guido/.Data.fs"
@@ -21,7 +22,7 @@
from BTrees.OIBTree import OIBTree
from Products.ZCTextIndex.NBest import NBest
-from Products.ZCTextIndex.Index import Index
+from Products.ZCTextIndex.OkapiIndex import Index
from Products.ZCTextIndex.Lexicon import Lexicon, Splitter
from Products.ZCTextIndex.Lexicon import CaseNormalizer, StopWordRemover
from Products.ZCTextIndex.QueryParser import QueryParser
@@ -404,10 +405,7 @@
return self.index.query_weight(terms)
def reportexc():
- type, exc = sys.exc_info()[:2]
- if hasattr(type, "__name__"):
- type = type.__name__
- print "%s: %s" % (type, exc)
+ traceback.print_exc()
if __name__ == "__main__":
main()