aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-08-06 09:46:04 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-08-06 09:46:04 -0500
commit3a6a03805abeb8aa5ab080f79a94d65d02421c7f (patch)
tree5bf4e9e28a366b9ce02e32aaa562d74e735f7048
parentTest extras parsers & move imports inside those parsers (diff)
downloadconfig-file-3a6a03805abeb8aa5ab080f79a94d65d02421c7f.zip
Update README example to remove MissingKeyError
-rw-r--r--README.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/README.md b/README.md
index 2b51ac0..96a27af 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,8 @@ for the package to recognize it and use the correct parser for it.
### Setting up ConfigFile
-To use the package, we import in the `ConfigFile` object.
+To use the package, we import in the `ConfigFile` object. This object
+is the only thing considered to be part of the public API.
We can set it up by giving it a string or `pathlib.Path` as the argument.
Any home tildes `~` in the string or `Path` are recognized and converted
@@ -132,11 +133,9 @@ There are two ways we could handle that.
The first is the one we're used to seeing: catch the error.
```python
-from config_file import MissingKeyError
-
try:
important_value = config.get('section.i_do_not_exist')
-except MissingKeyError:
+except KeyError:
important_value = 42
```