title: Change in Metaclass handling between python 3.4 and 3.5
body: <p>I have the following structure (for overriding Django model behaviour):</p>
  
  <pre><code>class CustomModelBase(models.base.ModelBase):
      ...
  
  class CustomModel(six.with_metaclass(CustomModelBase), models.base.Model):
      ...
  </code></pre>
  
  <p>where in <code>django.db.models.base</code>, Model is defined as:</p>
  
  <pre><code>class Model(six.with_metaclass(ModelBase)):
      ...
  </code></pre>
  
  <p>So, I have a class <code>CustomModel</code> derived from <code>Model</code>. The metaclass of <code>Model</code> is <code>ModelBase</code>. The derived class has a metaclass of <code>CustomModelBase</code>, which is derived from <code>ModelBase</code>.</p>
  
  <p>Under python 3.4.5, this was fine. Running this under python 3.5.3, and I get:</p>
  
  <pre><code>    class CustomModel(six.with_metaclass(CustomModelBase), models.Model):
  TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
  </code></pre>
  
  <p>Which it is...so I'm not sure exactly why it's complaining, and going through the change list from python 3.4 to 3.5 mentions nothing I can see that would change this behaviour (Django version is 1.10.4 and hasn't changed).</p>