mirror of https://github.com/ansible/ansible.git
* Address compat issue for collection loading on py26
* Move import_module shim to utils for compat across the codebase
* Enable collection tests on py2.6
* Update changelog fragment
* Simplify code using sys.moduls
* Move compat to module_utils/compat/importlib
* Add back errantly deleted newline
* Remove hack comment
Co-Authored-By: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit da3a90e88e
)
Co-authored-by: Matt Martz <matt@sivel.net>
pull/69999/head
parent
c57ca3fbf2
commit
380be7581e
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- Create an ``import_module`` compat util, for use across the codebase, to allow collection loading to work properly on Python26
|
@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2020 Matt Martz <matt@sivel.net>
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
from importlib import import_module
|
||||
except ImportError:
|
||||
# importlib.import_module returns the tail
|
||||
# whereas __import__ returns the head
|
||||
# compat to work like importlib.import_module
|
||||
def import_module(name):
|
||||
__import__(name)
|
||||
return sys.modules[name]
|
@ -1,5 +1,4 @@
|
||||
posix
|
||||
shippable/posix/group4
|
||||
shippable/windows/group2
|
||||
skip/python2.6
|
||||
windows
|
||||
|
Loading…
Reference in New Issue