diff --git a/CHANGES/26.bugfix.rst b/CHANGES/26.bugfix.rst new file mode 100644 index 0000000..4f6c208 --- /dev/null +++ b/CHANGES/26.bugfix.rst @@ -0,0 +1 @@ +Fixed loading the C-extensions on Python 3.8 -- by :user:`bdraco`. diff --git a/src/propcache/_helpers_c.pyx b/src/propcache/_helpers_c.pyx index 5369e12..3999a67 100644 --- a/src/propcache/_helpers_c.pyx +++ b/src/propcache/_helpers_c.pyx @@ -1,5 +1,13 @@ # cython: language_level=3 -from types import GenericAlias +import sys +import types + +if sys.version_info >= (3, 9): + GenericAlias = types.GenericAlias +else: + + def GenericAlias(cls): + return cls cdef _sentinel = object()