[pypy-commit] pypy default: MAXCODE is 65535 when CODESIZE is 2 (win32)

mattip pypy.commits at gmail.com
Sun Nov 10 18:16:33 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r98010:08b530929d7b
Date: 2019-11-10 16:43 -0500
http://bitbucket.org/pypy/pypy/changeset/08b530929d7b/

Log:	MAXCODE is 65535 when CODESIZE is 2 (win32)

diff --git a/rpython/rlib/rsre/rsre_core.py b/rpython/rlib/rsre/rsre_core.py
--- a/rpython/rlib/rsre/rsre_core.py
+++ b/rpython/rlib/rsre/rsre_core.py
@@ -96,8 +96,10 @@
     def __init__(self, pattern):
         self.pattern = pattern
         # check we don't get the old value of MAXREPEAT
-        # during the untranslated tests
-        if not we_are_translated():
+        # during the untranslated tests. 
+        # On python3, MAXCODE can appear in patterns. It will be 65535
+        # when CODESIZE is 2
+        if not we_are_translated() and rsre_char.CODESIZE != 2:
             assert 65535 not in pattern
 
     def pat(self, index):


More information about the pypy-commit mailing list