summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index b040d87..efb704b 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2355,11 +2355,19 @@ __declspec(dllexport)
#endif
init_sre(void)
{
+ PyObject* m;
+ PyObject* d;
+
/* Patch object types */
Pattern_Type.ob_type = Match_Type.ob_type =
Scanner_Type.ob_type = &PyType_Type;
- Py_InitModule("_" MODULE, _functions);
+ m = Py_InitModule("_" MODULE, _functions);
+ d = PyModule_GetDict(m);
+
+ PyDict_SetItemString(
+ d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
+ );
}
#endif /* !defined(SRE_RECURSIVE) */