b7662f7e5b
* Import from urllib and not url In Python 3, the correct way to import urlparse is through urllib.parse. * Use six module to import urlparse Import urlparse from ansible.module_utils.six. This way, the import statement is compatible both with Python 3 and Python 2. * Fix urlparse import using six module The correct import is: from six.moves.urllib.parse import urlparse * Import six from ansible.compat * Import from six.moves. Don't make six global. Prevent code smell by not making six available in the global namespace and instead importing from one of its subpackages. |
||
---|---|---|
.. | ||
ansible |