Skip to content

Commit 74daca7

Browse files
committed
fix: python specialform type name in py3.9
1 parent 961e19a commit 74daca7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sqlacodegen/generators.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,11 @@ def render_python_type(column_type: TypeEngine[Any]) -> str:
12491249
self.add_literal_import("typing", "Any")
12501250
python_type = Any
12511251

1252-
python_type_name = python_type.__name__
1252+
python_type_name = (
1253+
python_type.__name__
1254+
if hasattr(python_type, "__name__")
1255+
else python_type._name
1256+
)
12531257
python_type_module = python_type.__module__
12541258
if python_type_module == "builtins":
12551259
return python_type_name

0 commit comments

Comments
 (0)