From 5d907c1fdcf86cc5d2c029a6ac5b404fe79b0af7 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sun, 13 Mar 2022 14:45:44 +0100 Subject: [PATCH] fix: fix subscript error for type annotation in Python <=3.8 --- .changelog/_unreleased.toml | 5 +++++ src/pydoc_markdown/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changelog/_unreleased.toml diff --git a/.changelog/_unreleased.toml b/.changelog/_unreleased.toml new file mode 100644 index 00000000..7e5dab6a --- /dev/null +++ b/.changelog/_unreleased.toml @@ -0,0 +1,5 @@ +[[entries]] +id = "1dab5782-9dc8-4b38-9907-98f64a74c32f" +type = "fix" +description = "fix subscript error for type annotation in Python <=3.8" +author = "@NiklasRosenstein" diff --git a/src/pydoc_markdown/__init__.py b/src/pydoc_markdown/__init__.py index 61af0019..663453b6 100644 --- a/src/pydoc_markdown/__init__.py +++ b/src/pydoc_markdown/__init__.py @@ -149,7 +149,7 @@ def load_modules(self) -> t.List[docspec.Module]: logger.info('Loading modules.') self.ensure_initialized() - modules: list[docspec.Module] = [] + modules: t.List[docspec.Module] = [] for loader in self.loaders: modules.extend(loader.load()) return modules