| 184 | |
| 185 | namespace { |
| 186 | bool env_flag_enabled(const char* name, const bool default_value) { |
| 187 | const char* value = std::getenv(name); |
| 188 | if (!value || !*value) { |
| 189 | return default_value; |
| 190 | } |
| 191 | |
| 192 | const std::string_view text(value); |
| 193 | if (text == "1" || text == "true" || text == "TRUE" || text == "on" || text == "yes") { |
| 194 | return true; |
| 195 | } |
| 196 | if (text == "0" || text == "false" || text == "FALSE" || text == "off" || text == "no") { |
| 197 | return false; |
| 198 | } |
| 199 | return default_value; |
| 200 | } |
| 201 | |
| 202 | bool prepend_sys_path_once(PyObject* const sys_path, |
| 203 | const std::filesystem::path& path, |
no outgoing calls
no test coverage detected