[pypy-svn] r14146 - pypy/dist/lib-python/modified-2.3.4

niemeyer at codespeak.net niemeyer at codespeak.net
Sun Jul 3 16:28:34 CEST 2005


Author: niemeyer
Date: Sun Jul  3 16:28:33 2005
New Revision: 14146

Added:
   pypy/dist/lib-python/modified-2.3.4/sre_constants.py
      - copied, changed from r14036, pypy/dist/lib-python/2.3.4/sre_constants.py
Log:
Adding hack on modified-2.3.4/sre_constants.py file to make it work
on the 2.4 engine.


Copied: pypy/dist/lib-python/modified-2.3.4/sre_constants.py (from r14036, pypy/dist/lib-python/2.3.4/sre_constants.py)
==============================================================================
--- pypy/dist/lib-python/2.3.4/sre_constants.py	(original)
+++ pypy/dist/lib-python/modified-2.3.4/sre_constants.py	Sun Jul  3 16:28:33 2005
@@ -126,6 +126,14 @@
 
 ]
 
+# PyPy hack to make the sre_*.py files from 2.3.4 work on the _sre
+# engine of 2.4.
+import _sre
+if _sre.MAGIC > MAGIC:
+    GROUPREF_EXISTS = "groupref_exists"
+    OPCODES.insert(OPCODES.index(GROUPREF)+1, GROUPREF_EXISTS)
+del _sre
+
 ATCODES = [
     AT_BEGINNING, AT_BEGINNING_LINE, AT_BEGINNING_STRING, AT_BOUNDARY,
     AT_NON_BOUNDARY, AT_END, AT_END_LINE, AT_END_STRING,



More information about the Pypy-commit mailing list