Skip to content

Commit 35d1af8

Browse files
committed
Avoid dependency on modern python
1 parent 5495c73 commit 35d1af8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

openapi_core/unmarshalling/schemas/factories.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import warnings
23
from typing import Any
34
from typing import Dict
@@ -6,7 +7,10 @@
67
from typing import Type
78
from typing import Union
89

9-
from backports.cached_property import cached_property
10+
if sys.version_info >= (3, 9):
11+
from functools import cached_property
12+
else:
13+
from backports.cached_property import cached_property
1014
from jsonschema.protocols import Validator
1115
from openapi_schema_validator import OAS30Validator
1216

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ requests = {version = "*", optional = true}
6565
werkzeug = "*"
6666
typing-extensions = "^4.3.0"
6767
jsonschema-spec = "^0.1.1"
68-
backports-cached-property = "^1.0.2"
68+
backports-cached-property = {version = "^1.0.2", python = "<3.9" }
6969

7070
[tool.poetry.extras]
7171
django = ["django"]

0 commit comments

Comments
 (0)