summaryrefslogtreecommitdiff
path: root/Lib/sre_constants.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-01-15 12:46:09 +0000
committerFredrik Lundh <fredrik@pythonware.com>2001-01-15 12:46:09 +0000
commit4696650cd386a54b20d7e5a812a80d5beb8609e5 (patch)
treea46778cbdcee02ee0512984224b25ff5522fd88a /Lib/sre_constants.py
parent1a90de05b84b4ccf12f0e661df3dfc90075ac46e (diff)
downloadcpython-4696650cd386a54b20d7e5a812a80d5beb8609e5.tar.gz
added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
Diffstat (limited to 'Lib/sre_constants.py')
-rw-r--r--Lib/sre_constants.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/sre_constants.py b/Lib/sre_constants.py
index a5e4bb8c1e..b429a33cbf 100644
--- a/Lib/sre_constants.py
+++ b/Lib/sre_constants.py
@@ -9,8 +9,15 @@
# See the sre.py file for information on usage and redistribution.
#
+# update when constants are added or removed
+
+MAGIC = 20010115
+
+# max code word in this release
+
MAXREPEAT = 65535
+# SRE standard exception (access as sre.error)
# should this really be here?
class error(Exception):
@@ -211,6 +218,8 @@ if __name__ == "__main__":
""")
+ f.write("#define SRE_MAGIC %d\n" % MAGIC)
+
dump(f, OPCODES, "SRE_OP")
dump(f, ATCODES, "SRE")
dump(f, CHCODES, "SRE")