From 5a8654bffc4ac3e7adf3fdfffccf9efa07fa0c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rubin?= Date: Mon, 17 Oct 2022 16:21:24 +0200 Subject: [PATCH] fix(format): Fix PythonVersion.has_literal_type for Python 3.10. (#868) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł Rubin --- datamodel_code_generator/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datamodel_code_generator/format.py b/datamodel_code_generator/format.py index 9e19edc6b..6fbe885cc 100644 --- a/datamodel_code_generator/format.py +++ b/datamodel_code_generator/format.py @@ -17,7 +17,7 @@ class PythonVersion(Enum): @property def has_literal_type(self) -> bool: - return self.value >= self.PY_38.value # type: ignore + return self.value not in {self.PY_36.value, self.PY_37.value} # type: ignore if TYPE_CHECKING: