Mercurial > python-cmd2
comparison 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 |
comparison
equal
deleted
inserted
replaced
428:10c69502e789 | 429:47301bf13ec3 |
---|---|
39 import platform | 39 import platform |
40 import copy | 40 import copy |
41 from code import InteractiveConsole, InteractiveInterpreter | 41 from code import InteractiveConsole, InteractiveInterpreter |
42 from optparse import make_option | 42 from optparse import make_option |
43 import pyparsing | 43 import pyparsing |
44 pyparsing.ParserElement.enablePackrat() | |
45 | 44 |
46 __version__ = '0.6.3' | 45 __version__ = '0.6.3' |
46 | |
47 if sys.version_info[0] == 2: | |
48 pyparsing.ParserElement.enablePackrat() | |
49 | |
50 """ | |
51 Packrat is causing Python3 errors that I don't understand. | |
52 | |
53 > /usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py(999)scanString() | |
54 -> nextLoc,tokens = parseFn( instring, preloc, callPreParse=False ) | |
55 (Pdb) n | |
56 NameError: global name 'exc' is not defined | |
57 | |
58 (Pdb) parseFn | |
59 <bound method Or._parseCache of {Python style comment ^ C style comment}> | |
60 """ | |
47 | 61 |
48 class OptionParser(optparse.OptionParser): | 62 class OptionParser(optparse.OptionParser): |
49 def exit(self, status=0, msg=None): | 63 def exit(self, status=0, msg=None): |
50 self.values._exit = True | 64 self.values._exit = True |
51 if msg: | 65 if msg: |