Skip to content

Conversation

@jmoldow
Copy link
Contributor

@jmoldow jmoldow commented Sep 18, 2017

Add a fallback for six.raise_from, which isn't available in
six 1.4.0. It isn't available until six 1.9.0. We could also
have raised the lower bound for the six requirement, but this is
an easy way to allow clients to keep using their existing
versions of six.

Fix support for the latest version of six, 1.11.0. That release
changed the temporary metaclass returned from
with_metaclass(), such that it directly inherits from type,
instead of inheriting from the target metaclass [1]. We depended
on this detail, and the change caused

.. code-block:: python

TypeError('metaclass conflict: ...')

to be raised when defining a class with with_metaclass(). We
fix this by manually selecting the most derived metaclass, and
including it in our temporary metaclass.

Also, __prepare__ is now defined on the temporary metaclass,
in six 1.11.0 [2]. This allows us to skip our own definition of that
method, when using six>=1.11.0.

Fixes #228.

Fixes #239.

[1] benjaminp/six#191
[2] benjaminp/six#178

Add a fallback for `six.raise_from`, which isn't available in
six 1.4.0. It isn't available until six 1.9.0. We could also
have raised the lower bound for the six requirement, but this is
an easy way to allow clients to keep using their existing
versions of six.

Fix support for the latest version of six, 1.11.0. That release
changed the temporary metaclass returned from
`with_metaclass()`, such that it directly inherits from `type`,
instead of inheriting from the target metaclass [1]. We depended
on this detail, and the change caused

.. code-block:: python

    TypeError('metaclass conflict: ...')

to be raised when defining a class with `with_metaclass()`. We
fix this by manually selecting the most derived metaclass, and
including it in our temporary metaclass.

Also, `__prepare__` is now defined on the temporary metaclass,
in six 1.11.0 [2]. This allows us to skip our own definition of that
method, when using six>=1.11.0.

Fixes #228.

Fixes #239.

[1] <benjaminp/six#191>
[2] <benjaminp/six#178>
@boxcla
Copy link

boxcla commented Sep 18, 2017

Verified that @jmoldow has signed the CLA. Thanks for the pull request!

@jmoldow jmoldow merged commit ad58f15 into 1.5 Sep 19, 2017
@jmoldow jmoldow deleted the six_fixes_1.5 branch September 19, 2017 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants