Refs #27025 -- Fixed Python 3.6 deprecation warning for empty model super() calls.

https://bugs.python.org/issue23722

Thanks Nick Coghlan for advice and review.
This commit is contained in:
Tim Graham 2016-12-05 19:37:23 -05:00 committed by GitHub
parent 2d259e6bad
commit dd99e69fa8
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,11 @@ class ModelBase(type):
# Create the class. # Create the class.
module = attrs.pop('__module__') module = attrs.pop('__module__')
new_class = super_new(cls, name, bases, {'__module__': module}) new_attrs = {'__module__': module}
classcell = attrs.pop('__classcell__', None)
if classcell is not None:
new_attrs['__classcell__'] = classcell
new_class = super_new(cls, name, bases, new_attrs)
attr_meta = attrs.pop('Meta', None) attr_meta = attrs.pop('Meta', None)
abstract = getattr(attr_meta, 'abstract', False) abstract = getattr(attr_meta, 'abstract', False)
if not attr_meta: if not attr_meta: