Skip to content

Commit

Permalink
Fix missing __future__ import for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
AWhetter committed Aug 29, 2024
1 parent 1d1aa29 commit 1a0db7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autoapi/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
This extension allows you to automagically generate API documentation from your project.
"""

from __future__ import annotations

import os
import shutil
from typing import Dict, Tuple

import sphinx
from sphinx.util.console import colorize
Expand Down Expand Up @@ -40,7 +41,7 @@
"method",
"attribute",
]
_VIEWCODE_CACHE: Dict[str, tuple[str, dict[str, tuple[str, int, int]]]] = {}
_VIEWCODE_CACHE: dict[str, tuple[str, dict[str, tuple[str, int, int]]]] = {}
"""Caches a module's parse results for use in viewcode."""


Expand Down
3 changes: 3 additions & 0 deletions tests/python/py3example/example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def __len__(self):

class InheritBaseError(Exception):
"""The base exception."""

def __init__(self):
self.my_message = "one"
"""My message."""
Expand All @@ -197,6 +198,7 @@ def __init__(self):

class InheritError(InheritBaseError):
"""The middle exception."""

def __init__(self):
self.my_other_message = "two"
"""My other message."""
Expand All @@ -209,6 +211,7 @@ class SubInheritError(InheritError):

class DuplicateInheritError(InheritBaseError):
"""Not the base exception."""

def __init__(self):
self.my_message = "three"
super().__init__()

0 comments on commit 1a0db7d

Please sign in to comment.