Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Fix collections.abc deprecation #474

Merged
merged 1 commit into from
Jan 7, 2019
Merged

Fix collections.abc deprecation #474

merged 1 commit into from
Jan 7, 2019

Conversation

Eric-Arellano
Copy link
Contributor

Problem

In Python 3, the collections type classes (e.g. MutableMapping, Iterable) were moved to collections.abc. They were kept in collections for backwards compatibility, but will be removed in Python 3.8 and cause a deprecation warning in Python 3.7.

This leads to deprecation warnings for any Commons consumers, such as Pants.

Solution

Try to import collections.abc, and fall back to collections.

This fallback will be necessary until Commons would ever decide to drop Python 2 support, if that ever would even happen.

@CLAassistant
Copy link

CLAassistant commented Dec 21, 2018

CLA assistant check
All committers have signed the CLA.

@Eric-Arellano
Copy link
Contributor Author

cc @stuhood @kwlzn

@kwlzn kwlzn merged commit ba6453e into twitter-archive:master Jan 7, 2019
@Eric-Arellano Eric-Arellano deleted the fix-collections-abc branch January 8, 2019 00:28
stuhood pushed a commit to pantsbuild/pants that referenced this pull request Jan 18, 2019
### Problem

Use of `twitter.common.*==0.3.9` under Python 3 triggered deprecation warnings, which were fixed upstream in twitter-archive/commons#474

### Solution

Pull in `twitter.common.*==0.3.10` to remove the deprecation warnings.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants