Skip to content

Commit

Permalink
Making Python env manager path variable configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Varghese <[email protected]>
  • Loading branch information
Sachin Varghese committed Oct 17, 2024
1 parent 35a1c1f commit b517684
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pb_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ RecursiveDirectoryDelete(const char* dir)
EnvironmentManager::EnvironmentManager()
{
char tmp_dir_template[PATH_MAX + 1];
strcpy(tmp_dir_template, "/tmp/python_env_XXXXXX");
std::string tmp_dir_path_str = "/tmp/python_env_XXXXXX";
char* tmp_dir_template_path = std::getenv("TMP_PY_ENV_PATH");
if (tmp_dir_template_path != nullptr) {
tmp_dir_path_str = tmp_dir_template_path;
}
strcpy(tmp_dir_template, tmp_dir_path_str);

char* env_path = mkdtemp(tmp_dir_template);
if (env_path == nullptr) {
Expand Down

0 comments on commit b517684

Please sign in to comment.