diff --git a/expose/config.py b/expose/config.py
index cb60da67a7d59647545b7af084bb7f77f716f780..b248089f8481101616ceea7a6618eac843df2455 100644
--- a/expose/config.py
+++ b/expose/config.py
@@ -3,12 +3,12 @@
 """Functionality to implement python-based config file parsing and loading.
 """
 
-import re
-import sys
 import logging
 import os.path
 import pathlib
 import pkgutil
+import re
+import sys
 import types
 import typing
 
@@ -119,7 +119,8 @@ def _retrieve_entry_points(group: str) -> typing.Iterable[EntryPoint]:
     """
 
     if sys.version_info[:2] < (3, 10):
-        return entry_points()[group]  # Python 3.8 and 3.9
+        all_entry_points = entry_points()
+        return all_entry_points.get(group, [])  # Python 3.8 and 3.9
 
     return entry_points(group=group)  # Python 3.10 and above
 
diff --git a/tests/test_click.py b/tests/test_click.py
index 22cecc0ee30410d5bce73224c2a25bfc50880383..dbc9cf3857f747f72645ec9c325cb502b6c784a6 100644
--- a/tests/test_click.py
+++ b/tests/test_click.py
@@ -163,9 +163,7 @@ def test_config_dump(tmp_path, datadir):
 
 
 def test_config_dump2(tmp_path, datadir):
-    @click.command(
-        cls=ConfigCommand, entry_point_group="expose.test.config"
-    )
+    @click.command(cls=ConfigCommand, entry_point_group="expose.test.config")
     @click.option(
         "--database",
         "-d",