diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-05 19:37:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-05 19:37:23 -0500 |
| commit | dd99e69fa8f89263d0396f23e0db9aa8fa667b01 (patch) | |
| tree | 5f47a14fe5bc1b2c3bacc58b97b59e4d59fad41b /django/db | |
| parent | 2d259e6badf032fbdc41f4a2c96a545a94a9ec91 (diff) | |
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.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/base.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index e20979770c..6b4eb25009 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -89,7 +89,11 @@ class ModelBase(type): # Create the class. 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) abstract = getattr(attr_meta, 'abstract', False) if not attr_meta: |
