We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d05e0c0 commit cb4d5ecCopy full SHA for cb4d5ec
1 file changed
src/dotenv/main.py
@@ -423,6 +423,7 @@ def load_dotenv(
423
logger.warning("Copying %s to %s", init_dotenv_path, copy_dotenv_path)
424
import shutil
425
426
+ assert init_dotenv_path is not None
427
shutil.copyfile(init_dotenv_path, copy_dotenv_path)
428
429
if dotenv_path is None and stream is None:
@@ -445,9 +446,9 @@ def should_copy_init(
445
446
stream: Optional[IO[str]],
447
) -> bool:
448
dotenv_path = arg_dotenv_path or ".env"
- return (
449
+ return bool(
450
(stream is None)
- and init_dotenv_path
451
+ and (init_dotenv_path is not None)
452
and os.path.exists(init_dotenv_path)
453
and (not os.path.exists(dotenv_path))
454
)
0 commit comments