Skip to content

Commit 94e4059

Browse files
sunaleyhim0116
authored andcommitted
Set BASE_DIR to sys path also
1 parent 16f2bda commit 94e4059

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/dotenv/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def set_as_environment_variables(self) -> bool:
107107
if k in os.environ and not self.override:
108108
continue
109109
if v is not None:
110-
os.environ[k] = v
110+
os.environ[to_env(k)] = to_env(v)
111+
if to_env(k) == 'BASE_DIR' and to_env(v) not in sys.path:
112+
logger.info('Append BASE_DIR to path.')
113+
sys.path.append(to_env(v))
111114

112115
return True
113116

0 commit comments

Comments
 (0)