Catch AmbiguousMatch when printing syntax tree of an XPath expression.
authorFrederic Jolliton <frederic@jolliton.com>
Mon, 12 Sep 2005 08:01:50 +0000 (08:01 +0000)
committerFrederic Jolliton <frederic@jolliton.com>
Mon, 12 Sep 2005 08:01:50 +0000 (08:01 +0000)
git-archimport-id: frederic@jolliton.com--2005-main/tx--main--0.1--patch-29

xpath_prompt.py

index 23d04ed..ca681a7 100755 (executable)
@@ -30,7 +30,7 @@ import xpathparser
 from sequence import Sequence
 from nodes import Node, Document
 from error import Error
-from parser import NoMatch
+from parser import NoMatch, AmbiguousMatch
 from sequence_misc import printSequence
 from xpathfn import *
 
@@ -208,6 +208,8 @@ def main() :
                                        print lispy( xpathparser.parse( cmd[ 1 : ].strip() ) )
                                except NoMatch , e :
                                        print e
+                               except AmbiguousMatch , e :
+                                       print e
                        elif cmd == 'c' :
                                import xpath
                                xpath.flushCache()