Skip to content

Commit 6be478e

Browse files
author
Sachin Varghese
committed
Making Python env manager path variable configurable
1 parent 35a1c1f commit 6be478e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pb_env.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ RecursiveDirectoryDelete(const char* dir)
229229
EnvironmentManager::EnvironmentManager()
230230
{
231231
char tmp_dir_template[PATH_MAX + 1];
232-
strcpy(tmp_dir_template, "/tmp/python_env_XXXXXX");
232+
std::string tmp_dir_path_str = "/tmp/python_env_XXXXXX";
233+
char* tmp_dir_template_path = std::getenv("TMP_PY_ENV_PATH");
234+
if (tmp_dir_template_path != nullptr) {
235+
tmp_dir_path_str = tmp_dir_template_path;
236+
}
237+
strcpy(tmp_dir_template, tmp_dir_path_str);
233238

234239
char* env_path = mkdtemp(tmp_dir_template);
235240
if (env_path == nullptr) {

0 commit comments

Comments
 (0)