mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
This commit is contained in:
parent
142297ac92
commit
b35ffc0417
4 changed files with 21 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue