diff options
author | Matt Clay <matt@mystile.com> | 2022-03-04 17:20:18 -0800 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2022-03-07 09:21:46 -0800 |
commit | 3a3c496ade07247d7d275b2461d8fbe0e8be1d6b (patch) | |
tree | 38a685be9a0dc6afcad6b47bc4ee32654054b52e /lib/ansible/utils | |
parent | 0c4c18bc04c562755a368df67fce943ca15418ee (diff) | |
download | ansible-3a3c496ade07247d7d275b2461d8fbe0e8be1d6b.tar.gz |
Remove obsolete Python 2.x compat code.
Diffstat (limited to 'lib/ansible/utils')
-rw-r--r-- | lib/ansible/utils/hashing.py | 8 | ||||
-rw-r--r-- | lib/ansible/utils/multiprocessing.py | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/ansible/utils/hashing.py b/lib/ansible/utils/hashing.py index 1fd4457e80..71300d6192 100644 --- a/lib/ansible/utils/hashing.py +++ b/lib/ansible/utils/hashing.py @@ -23,15 +23,11 @@ import os from hashlib import sha1 -# Backwards compat only try: from hashlib import md5 as _md5 except ImportError: - try: - from md5 import md5 as _md5 - except ImportError: - # Assume we're running in FIPS mode here - _md5 = None + # Assume we're running in FIPS mode here + _md5 = None from ansible.errors import AnsibleError from ansible.module_utils._text import to_bytes diff --git a/lib/ansible/utils/multiprocessing.py b/lib/ansible/utils/multiprocessing.py index dcc186597a..2912f71230 100644 --- a/lib/ansible/utils/multiprocessing.py +++ b/lib/ansible/utils/multiprocessing.py @@ -14,8 +14,4 @@ import multiprocessing # # This exists in utils to allow it to be easily imported into various places # without causing circular import or dependency problems -try: - context = multiprocessing.get_context('fork') -except AttributeError: - # Py2 has no context functionality, and only supports fork - context = multiprocessing +context = multiprocessing.get_context('fork') |