diff options
author | Adrien Ferrand <adferrand@users.noreply.github.com> | 2021-03-10 22:51:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 22:51:27 +0300 |
commit | dd6f2f565e8183b69ff3abf5d965d0d1575b2e5e (patch) | |
tree | 9c7547ddedba4a9a5d489780c916c1cf98500ae5 /certbot-compatibility-test | |
parent | f2d8c81e9b8165a37c27641a49b447e55921147e (diff) |
Convert Python 2 type hints to Python 3 types annotations (#8640)
Fixes #8427
This PR converts the Python 2 types hints into Python 3 types annotations. I have used the project https://github.com/ilevkivskyi/com2ann which has been designed for that specific purpose and did that very well.
The only remaining things to do were to fix broken type hints that became wrong code after migration, and to fix lines too long with the new syntax.
* Raw execution of com2ann
* Fixing broken type annotations
* Cleanup imports
Diffstat (limited to 'certbot-compatibility-test')
-rw-r--r-- | certbot-compatibility-test/certbot_compatibility_test/configurators/nginx/common.py | 2 | ||||
-rw-r--r-- | certbot-compatibility-test/certbot_compatibility_test/test_driver.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/certbot-compatibility-test/certbot_compatibility_test/configurators/nginx/common.py b/certbot-compatibility-test/certbot_compatibility_test/configurators/nginx/common.py index 58b72c205..d7b7a120e 100644 --- a/certbot-compatibility-test/certbot_compatibility_test/configurators/nginx/common.py +++ b/certbot-compatibility-test/certbot_compatibility_test/configurators/nginx/common.py @@ -68,7 +68,7 @@ def _get_server_root(config): def _get_names(config): """Returns all and testable domain names in config""" - all_names = set() # type: Set[str] + all_names: Set[str] = set() for root, _dirs, files in os.walk(config): for this_file in files: update_names = _get_server_names(root, this_file) diff --git a/certbot-compatibility-test/certbot_compatibility_test/test_driver.py b/certbot-compatibility-test/certbot_compatibility_test/test_driver.py index fe634ba9f..4bb16e63f 100644 --- a/certbot-compatibility-test/certbot_compatibility_test/test_driver.py +++ b/certbot-compatibility-test/certbot_compatibility_test/test_driver.py @@ -178,7 +178,7 @@ def test_enhancements(plugin, domains): "enhancements") return False - domains_and_info = [(domain, []) for domain in domains] # type: List[Tuple[str, List[bool]]] + domains_and_info: List[Tuple[str, List[bool]]] = [(domain, []) for domain in domains] for domain, info in domains_and_info: try: |