Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
020036f8
Commit
020036f8
authored
Feb 16, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: add a nasty hack for Ansible modules.
parent
875ee29d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
mitogen/core.py
mitogen/core.py
+7
-1
No files found.
mitogen/core.py
View file @
020036f8
...
...
@@ -546,7 +546,13 @@ class Importer(object):
self
.
_present
[
fullname
]
=
pkg_present
else
:
mod
.
__package__
=
fullname
.
rpartition
(
'.'
)[
0
]
or
None
code
=
compile
(
self
.
get_source
(
fullname
),
mod
.
__file__
,
'exec'
)
# TODO: monster hack: work around modules now being imported as their
# actual name, so when Ansible "apt.py" tries to "import apt", it gets
# itself. Instead force absolute imports during compilation.
flags
=
0x4000
if
fullname
.
startswith
(
'ansible'
)
else
0
source
=
self
.
get_source
(
fullname
)
code
=
compile
(
source
,
mod
.
__file__
,
'exec'
,
flags
,
True
)
exec
code
in
vars
(
mod
)
return
mod
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment