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
d4169557
Commit
d4169557
authored
Feb 25, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some more Python 2.4 syntax
parent
6426cb85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
mitogen/core.py
mitogen/core.py
+6
-2
No files found.
mitogen/core.py
View file @
d4169557
...
...
@@ -550,7 +550,9 @@ class Importer(object):
# 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
flags
=
0
if
fullname
.
startswith
(
'ansible'
):
flags
=
0x4000
source
=
self
.
get_source
(
fullname
)
code
=
compile
(
source
,
mod
.
__file__
,
'exec'
,
flags
,
True
)
exec
code
in
vars
(
mod
)
...
...
@@ -1282,11 +1284,13 @@ class ExternalContext(object):
def
_setup_importer
(
self
,
core_src_fd
,
whitelist
,
blacklist
):
if
core_src_fd
:
with
os
.
fdopen
(
101
,
'r'
,
1
)
as
fp
:
fp
=
os
.
fdopen
(
101
,
'r'
,
1
)
try
:
core_size
=
int
(
fp
.
readline
())
core_src
=
fp
.
read
(
core_size
)
# Strip "ExternalContext.main()" call from last line.
core_src
=
'
\
n
'
.
join
(
core_src
.
splitlines
()[:
-
1
])
finally
:
fp
.
close
()
else
:
core_src
=
None
...
...
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