diff --git a/README.md b/README.md index 6f4b78d..0eddd9e 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,11 @@ tomli >= 1.1.0 ; python_version < "3.11" Then, in your code, import a TOML parser using the following fallback mechanism: ```python -try: +import sys + +if sys.version_info >= (3, 11): import tomllib -except ModuleNotFoundError: +else: import tomli as tomllib tomllib.loads("['This parses fine with Python 3.6+']")