mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Make configparser imports python3 ready
the ConfigParser module was renamed to configparser in Python3. Use six.moves to import it so that the modules will function on Python3.
This commit is contained in:
parent
272ff10fa1
commit
f75ffe46db
8 changed files with 41 additions and 45 deletions
|
@ -21,13 +21,7 @@ from io import StringIO
|
|||
import os
|
||||
import re
|
||||
|
||||
try:
|
||||
# python2
|
||||
import ConfigParser as configparser
|
||||
except ImportError:
|
||||
# python3
|
||||
import configparser
|
||||
|
||||
from ansible.compat.six.moves import configparser
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue