changeset 429:47301bf13ec3

no packrat for python3, darn
author catherine.devlin@gmail.com
date Thu, 28 Jul 2011 18:32:19 -0400
parents 10c69502e789
children 73e741441ac0
files INSTALL.txt cmd2.py
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL.txt	Thu Jul 28 17:46:18 2011 -0400
+++ b/INSTALL.txt	Thu Jul 28 18:32:19 2011 -0400
@@ -19,4 +19,5 @@
   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.  
--- 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