Skip to content

Commit

Permalink
Wrap cached_property import in try/except for Python 3.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbar committed Sep 27, 2022
1 parent 83dcba0 commit b0bf8f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
from warnings import warn
from collections import namedtuple
from collections.abc import Callable, Mapping
from functools import cached_property
import copy
import sys


# TODO: Remove try-except when support for Python 3.7 is dropped
try:
from functools import cached_property
except ImportError: # cached_property added in Python 3.8
cached_property = None


def strip_blank_lines(l):
"Remove leading and trailing blank lines from a list of lines"
while l and not l[0].strip():
Expand Down

0 comments on commit b0bf8f9

Please sign in to comment.