summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcatherine devlin <catherine.devlin@gmail.com>2011-07-28 18:32:19 -0400
committercatherine devlin <catherine.devlin@gmail.com>2011-07-28 18:32:19 -0400
commitf7327cf6d463a5a28377dab8ccb48af70b178e94 (patch)
treebcfd6e07c68fe4f85bd090dbcc172bf285eaf04e
parent9d1542030c093f2a664a267d3dbf0af00124f6be (diff)
downloadcmd2-hg-f7327cf6d463a5a28377dab8ccb48af70b178e94.tar.gz
no packrat for python3, darn
-rw-r--r--INSTALL.txt3
-rwxr-xr-xcmd2.py16
2 files changed, 17 insertions, 2 deletions
diff --git a/INSTALL.txt b/INSTALL.txt
index a6a21d5..76e138e 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -19,4 +19,5 @@ The best way to do this is to install ``distribute`` on Python 3 before installi
sudo python3 distribute_setup.py
sudo python3 setup.py install
-
+
+2to3 won't run if there's a ``build`` directory that's newer than your source code. Deleting the ``cmd2/build`` directory before running setup.py ensures that this won't be a problem.
diff --git a/cmd2.py b/cmd2.py
index 2d4cc76..ebbfab5 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -41,10 +41,24 @@ import copy
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