Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Mapping from collections.abc #98

Merged
merged 1 commit into from
Jun 27, 2018
Merged

Import Mapping from collections.abc #98

merged 1 commit into from
Jun 27, 2018

Conversation

The-Compiler
Copy link
Contributor

@The-Compiler The-Compiler commented Jun 27, 2018

In Python 3.7, importing ABCs directly from the collections module shows a
warning (and in Python 3.8 it will stop working) - see
python/cpython@c66f9f8

This fixes the following DeprecationWarning:

>>> import warnings
>>> warnings.simplefilter('default')
>>> import markupsafe
.../markupsafe/__init__.py:12: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping

In Python 3.7, importing ABCs directly from the `collections` module shows a
warning (and in Python 3.8 it will stop working) - see
python/cpython@c66f9f8

This fixes the following `DeprecationWarning`:

>>> import warnings
>>> warnings.simplefilter('default')
>>> import markupsafe
.../markupsafe/__init__.py:12: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping
@davidism davidism merged commit 46750f4 into pallets:master Jun 27, 2018
@davidism davidism added this to the 1.1 milestone Jun 27, 2018
@The-Compiler The-Compiler deleted the collections branch June 27, 2018 20:05
@The-Compiler
Copy link
Contributor Author

The-Compiler commented Jun 27, 2018

I just noticed I forgot to update the changelog - something like this might be appropriate?

diff --git a/CHANGES.rst b/CHANGES.rst
index 463ed38..831f8bc 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -11,8 +11,11 @@ Unreleased
 
 - ``escape`` wraps ``__html__`` result in ``Markup``, consistent with
   documented behavior. (`#69`_)
+- Fixed deprecation warning on Python 3.7 by importing from ``collections.abc``
+  instead of ``collections`` (`#98`_)
 
 .. _#69: https://github.com/pallets/markupsafe/pull/69
+.. _#98: https://github.com/pallets/markupsafe/pull/98
 
 
 Version 1.0

@davidism
Copy link
Member

This isn't the type of change we typically add to the changelog.

@tirkarthi tirkarthi mentioned this pull request Sep 14, 2018
@davidism davidism modified the milestone: 1.1 Oct 21, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2020
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.

2 participants