Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Raise FileNotFoundError when unable to locate the .cfg file specified by --config_file (#1070)

Lionel Ray78edb2a0bf9e
diff --git a/manim/_config/utils.py b/manim/_config/utils.py
index 0b5d8722b..c518fcbbd 100644
--- a/manim/_config/utils.py
+++ b/manim/_config/utils.py
@@ -14,6 +14,7 @@ import configparser
import copy
import logging
import os
+import errno
import sys
import typing
from collections.abc import Mapping, MutableMapping
@@ -737,6 +738,13 @@ class ManimConfig(MutableMapping):
multiple times.
"""
+ if not os.path.isfile(filename):
+ raise FileNotFoundError(
+ errno.ENOENT,
+ "Error: --config_file could not find a valid config file.",
+ filename,
+ )
+
if filename:
return self.digest_parser(make_config_parser(filename))