unknownfriend00007 commited on
Commit
d2e38cc
·
verified ·
1 Parent(s): 4bef769

Upload 8 files

Browse files
Files changed (1) hide show
  1. config.py +8 -4
config.py CHANGED
@@ -6,10 +6,14 @@ from pathlib import Path
6
 
7
 
8
  def _load_dotenv() -> None:
9
- candidates = [
10
- Path(__file__).resolve().parent / ".env",
11
- Path(__file__).resolve().parents[2] / ".env",
12
- ]
 
 
 
 
13
 
14
  for env_path in candidates:
15
  if not env_path.exists():
 
6
 
7
 
8
  def _load_dotenv() -> None:
9
+ here = Path(__file__).resolve()
10
+ module_dir = here.parent
11
+
12
+ candidates: list[Path] = [module_dir / ".env"]
13
+
14
+ # Optional project-root fallback when running from full repository layout.
15
+ if len(here.parents) > 2:
16
+ candidates.append(here.parents[2] / ".env")
17
 
18
  for env_path in candidates:
19
  if not env_path.exists():