Skip to content

Commit e7e6bc2

Browse files
committed
Add thread bootstrap names for Python2
1 parent 35bd6b5 commit e7e6bc2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/scorepy/events.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "events.hpp"
2+
#include <Python.h>
23
#include <algorithm>
34
#include <array>
45
#include <iostream>
@@ -37,8 +38,13 @@ void region_begin(const std::string& region_name, std::string module, std::strin
3738

3839
/// Region names that are known to have no region enter event and should not report an error
3940
/// on region exit
40-
static const std::array<std::string, 2> EXIT_REGION_WHITELIST = { "threading:_bootstrap_inner",
41-
"threading:_bootstrap" };
41+
static const std::array<std::string, 2> EXIT_REGION_WHITELIST = {
42+
#if PY_MAJOR_VERSION >= 3
43+
"threading:_bootstrap_inner", "threading:_bootstrap"
44+
#else
45+
"threading:__bootstrap_inner", "threading:__bootstrap"
46+
#endif
47+
};
4248

4349
void region_end(const std::string& region_name)
4450
{

0 commit comments

Comments
 (0)