ansible_mitogen: Fix ModuleNotFoundError: No module named 'ansible_mitogen'
Loading the ansible_mitogen Ansible plugins apparently doesn't follow the same
rules as importing a Python module. So sys.path manipulations in __init__.py
weren't fired when Ansible tried to load the plugins from a /custom/path that
wasn't already on sys.path.
This wasn't picked up by the test because CI always installs Mitogen as a
Python package (in a virtual env).
This reverses 6145508312.
pull/1352/head
parent
2305446ab8
commit
85069b28cd
@ -1,11 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: 2025 Mitogen authors <https://github.com/mitogen-hq>
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# !mitogen: minify_safe
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
try:
|
|
||||||
import ansible_mitogen
|
|
||||||
except ImportError:
|
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../../..')))
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: 2025 Mitogen authors <https://github.com/mitogen-hq>
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# !mitogen: minify_safe
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
try:
|
|
||||||
import ansible_mitogen
|
|
||||||
except ImportError:
|
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../../..')))
|
|
||||||
Loading…
Reference in New Issue