We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6beea4b commit 8381ea7Copy full SHA for 8381ea7
coverage/ctracer/module.c
@@ -9,18 +9,14 @@
9
10
#define MODULE_DOC PyDoc_STR("Fast coverage tracer.")
11
12
-static int module_loaded = 0;
+static BOOL module_inited = FALSE;
13
14
static int
15
tracer_exec(PyObject *mod)
16
{
17
- // https://docs.python.org/3/howto/isolating-extensions.html#opt-out-limiting-to-one-module-object-per-process
18
- if (module_loaded) {
19
- PyErr_SetString(PyExc_ImportError,
20
- "cannot load module more than once per process");
21
- return -1;
+ if (module_inited) {
+ return 0;
22
}
23
- module_loaded = 1;
24
25
if (CTracer_intern_strings() < 0) {
26
return -1;
@@ -52,6 +48,7 @@ tracer_exec(PyObject *mod)
52
48
53
49
54
50
51
+ module_inited = TRUE;
55
return 0;
56
57
0 commit comments