diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-30 12:57:56 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-30 12:57:56 -0500 |
| commit | e40a3a23fb6649758f40e9b67e3f3100ec23f116 (patch) | |
| tree | e3baca007967dac9fbd248bee22612399fe93494 | |
| parent | Fix typos and reword some paragraphs (diff) | |
| download | config-file-e40a3a23fb6649758f40e9b67e3f3100ec23f116.zip | |
Fix missing dependency error messages for yaml and toml
| -rw-r--r-- | config_file/parsers/toml_parser.py | 3 | ||||
| -rw-r--r-- | config_file/parsers/yaml_parser.py | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/config_file/parsers/toml_parser.py b/config_file/parsers/toml_parser.py index 58e20b9..1c7f8a7 100644 --- a/config_file/parsers/toml_parser.py +++ b/config_file/parsers/toml_parser.py @@ -9,11 +9,12 @@ from config_file.exceptions import MissingDependencyError from .base_parser import BaseParser + class TomlParser(BaseParser): def __init__(self, file_contents: str): if not TOML_AVAILABLE: raise MissingDependencyError( - "It doesn't appear `toml` is installed, but a toml " + "It doesn't appear `tomlkit` is installed, but a toml " "file was attempted to be used. Install the `toml` " "extra first with `pip install config-file[toml]`." ) diff --git a/config_file/parsers/yaml_parser.py b/config_file/parsers/yaml_parser.py index 1937e17..babe873 100644 --- a/config_file/parsers/yaml_parser.py +++ b/config_file/parsers/yaml_parser.py @@ -14,12 +14,12 @@ class YamlParser(BaseParser): def __init__(self, file_contents: str): if not YAML_AVAILABLE: raise MissingDependencyError( - "It doesn't appear `PyYaml` is installed, but a yaml " - "file was attempted to be used. Install the `toml` " - "extra first with `pip install config-file[toml]`." + "It doesn't appear `ruamel.yaml` is installed, but a yaml " + "file was attempted to be used. Install the `yaml` " + "extra first with `pip install config-file[yaml]`." ) - - yaml = YAML(typ='safe') + + yaml = YAML(typ="safe") yaml.loads = round_trip_load yaml.dumps = round_trip_dump |