Skip to content

Commit a2f2e95

Browse files
kam193davidism
authored andcommitted
subclass meta mixins from type
This fixes a regression introduced in CPython 3.8.4.
1 parent d257601 commit a2f2e95

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGES.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 2.4.4
2+
-------------
3+
4+
Unreleased
5+
6+
- Change base class of meta mixins to ``type``. This fixes an issue
7+
caused by a regression in CPython 3.8.4. :issue:`852`
8+
9+
110
Version 2.4.3
211
-------------
312

flask_sqlalchemy/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _join(match):
5959
return camelcase_re.sub(_join, name).lstrip('_')
6060

6161

62-
class NameMetaMixin(object):
62+
class NameMetaMixin(type):
6363
def __init__(cls, name, bases, d):
6464
if should_set_tablename(cls):
6565
cls.__tablename__ = camel_to_snake_case(cls.__name__)
@@ -111,7 +111,7 @@ def __table_cls__(cls, *args, **kwargs):
111111
del cls.__tablename__
112112

113113

114-
class BindMetaMixin(object):
114+
class BindMetaMixin(type):
115115
def __init__(cls, name, bases, d):
116116
bind_key = (
117117
d.pop('__bind_key__', None)

0 commit comments

Comments
 (0)