[pypy-commit] pypy rpython-resync: Kill the rsre_char.MAGIC nonsense
rlamy
pypy.commits at gmail.com
Sun Aug 28 01:19:11 EDT 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: rpython-resync
Changeset: r86632:f48df4d5e6d9
Date: 2016-08-28 06:13 +0100
http://bitbucket.org/pypy/pypy/changeset/f48df4d5e6d9/
Log: Kill the rsre_char.MAGIC nonsense
diff --git a/pypy/module/_sre/__init__.py b/pypy/module/_sre/__init__.py
--- a/pypy/module/_sre/__init__.py
+++ b/pypy/module/_sre/__init__.py
@@ -1,4 +1,4 @@
-from pypy.interpreter.mixedmodule import MixedModule
+from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
@@ -7,7 +7,7 @@
interpleveldefs = {
'CODESIZE': 'space.wrap(interp_sre.CODESIZE)',
- 'MAGIC': 'space.wrap(interp_sre.MAGIC)',
+ 'MAGIC': 'space.newint(20031017)',
'MAXREPEAT': 'space.wrap(interp_sre.MAXREPEAT)',
'compile': 'interp_sre.W_SRE_Pattern',
'getlower': 'interp_sre.w_getlower',
diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -14,7 +14,7 @@
# Constants and exposed functions
from rpython.rlib.rsre import rsre_core
-from rpython.rlib.rsre.rsre_char import MAGIC, CODESIZE, MAXREPEAT, getlower, set_unicode_db
+from rpython.rlib.rsre.rsre_char import CODESIZE, MAXREPEAT, getlower, set_unicode_db
@unwrap_spec(char_ord=int, flags=int)
diff --git a/rpython/rlib/rsre/rsre_char.py b/rpython/rlib/rsre/rsre_char.py
--- a/rpython/rlib/rsre/rsre_char.py
+++ b/rpython/rlib/rsre/rsre_char.py
@@ -23,10 +23,6 @@
#### Constants
-# Identifying as _sre from Python 2.3 and onwards (at least up to 2.7)
-# UPDATE: change was necessary for Python 3.3 changes
-MAGIC = 20140917
-
if sys.maxint > 2**32:
MAXREPEAT = int(2**32 - 1)
MAXGROUPS = int(2**31 - 1)
@@ -35,7 +31,7 @@
MAXGROUPS = int((2**31 / sys.maxint / 2) - 1)
# In _sre.c this is bytesize of the code word type of the C implementation.
-# There it's 2 for normal Python builds and more for wide unicode builds (large
+# There it's 2 for normal Python builds and more for wide unicode builds (large
# enough to hold a 32-bit UCS-4 encoded character). Since here in pure Python
# we only see re bytecodes as Python longs, we shouldn't have to care about the
# codesize. But sre_compile will compile some stuff differently depending on the
More information about the pypy-commit
mailing list