Skip to content

Commit 78edb2a

Browse files
Raise FileNotFoundError when unable to locate the .cfg file specified by --config_file (#1070)
* Added FileNotFoundError for --config_file argument when it's not found * Fixed Black formatting
1 parent 30f00d5 commit 78edb2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

manim/_config/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import copy
1515
import logging
1616
import os
17+
import errno
1718
import sys
1819
import typing
1920
from collections.abc import Mapping, MutableMapping
@@ -737,6 +738,13 @@ def digest_file(self, filename: str) -> "ManimConfig":
737738
multiple times.
738739
739740
"""
741+
if not os.path.isfile(filename):
742+
raise FileNotFoundError(
743+
errno.ENOENT,
744+
"Error: --config_file could not find a valid config file.",
745+
filename,
746+
)
747+
740748
if filename:
741749
return self.digest_parser(make_config_parser(filename))
742750

0 commit comments

Comments
 (0)