Prevent a crash if stdin is not defined (#3609)

This commit is contained in:
Devon Stewart
2024-04-17 12:15:27 -07:00
committed by GitHub
parent 59a295f5f9
commit 652813da4b

View File

@@ -362,7 +362,7 @@ def load_config(
from mkdocs.config.defaults import MkDocsConfig
if config_file_path is None:
if fd is not sys.stdin.buffer:
if sys.stdin and fd is not sys.stdin.buffer:
config_file_path = getattr(fd, 'name', None)
cfg = MkDocsConfig(config_file_path=config_file_path)
# load the config file