Fix collections.abc imports for Python 3.9 (#7707)

* Fix collections.abc imports for Python 3.9

* Update AUTHORS.md

* No longer ignore collections.abc deprecation warning

* Update changelog

* Remove outdated comment

* Disabling no-name-in-module not needed as linting is on Python 3
This commit is contained in:
Hugo van Kemenade 2020-01-24 15:13:58 +02:00 committed by Adrien Ferrand
parent 5f315b46e9
commit 2f24726d4c
4 changed files with 9 additions and 6 deletions

View file

@ -100,6 +100,7 @@ Authors
* [Harlan Lieberman-Berg](https://github.com/hlieberman)
* [Henri Salo](https://github.com/fgeek)
* [Henry Chen](https://github.com/henrychen95)
* [Hugo van Kemenade](https://github.com/hugovk)
* [Ingolf Becker](https://github.com/watercrossing)
* [Jaap Eldering](https://github.com/eldering)
* [Jacob Hoffman-Andrews](https://github.com/jsha)

View file

@ -15,7 +15,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
### Fixed
*
* Fix collections.abc imports for Python 3.9.
More details about these changes can be found on our GitHub repo.

View file

@ -13,6 +13,12 @@ from certbot import errors
from certbot import interfaces
from certbot._internal import constants
try:
# Python 3.3+
from collections.abc import Mapping
except ImportError: # pragma: no cover
from collections import Mapping
logger = logging.getLogger(__name__)
@ -178,7 +184,7 @@ class PluginEntryPoint(object):
return "\n".join(lines)
class PluginsRegistry(collections.Mapping):
class PluginsRegistry(Mapping):
"""Plugins registry."""
def __init__(self, plugins):

View file

@ -4,10 +4,6 @@
[pytest]
# In general, all warnings are treated as errors. Here are the exceptions:
# 1- decodestring: https://github.com/rthalley/dnspython/issues/338
# 2- ignore warn for importing abstract classes from collections instead of collections.abc,
# too much third party dependencies are still relying on this behavior,
# but it should be corrected to allow Certbot compatibility with Python >= 3.8
filterwarnings =
error
ignore:decodestring:DeprecationWarning
ignore:.*collections\.abc:DeprecationWarning