Mercurial > python-cmd2
diff cmd2.py @ 429:47301bf13ec3
no packrat for python3, darn
author | catherine.devlin@gmail.com |
---|---|
date | Thu, 28 Jul 2011 18:32:19 -0400 |
parents | 3c17dae50252 |
children | 73e741441ac0 |
line wrap: on
line diff
--- a/cmd2.py Thu Jul 28 17:46:18 2011 -0400 +++ b/cmd2.py Thu Jul 28 18:32:19 2011 -0400 @@ -41,10 +41,24 @@ from code import InteractiveConsole, InteractiveInterpreter from optparse import make_option import pyparsing -pyparsing.ParserElement.enablePackrat() __version__ = '0.6.3' +if sys.version_info[0] == 2: + pyparsing.ParserElement.enablePackrat() + +""" +Packrat is causing Python3 errors that I don't understand. + +> /usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py(999)scanString() +-> nextLoc,tokens = parseFn( instring, preloc, callPreParse=False ) +(Pdb) n +NameError: global name 'exc' is not defined + +(Pdb) parseFn +<bound method Or._parseCache of {Python style comment ^ C style comment}> +""" + class OptionParser(optparse.OptionParser): def exit(self, status=0, msg=None): self.values._exit = True