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
c810f66b
Commit
c810f66b
authored
Sep 23, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue #19: whoops, implement sliding window properly
parent
43ccbf04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
mitogen/master.py
mitogen/master.py
+11
-7
No files found.
mitogen/master.py
View file @
c810f66b
...
...
@@ -210,21 +210,25 @@ def scan_code_imports(co, LOAD_CONST=dis.opname.index('LOAD_CONST'),
# Yield `(op, oparg)` tuples from the code object `co`.
ordit
=
itertools
.
imap
(
ord
,
co
.
co_code
)
nextb
=
ordit
.
next
opit
=
((
c
,
(
None
if
c
<
dis
.
HAVE_ARGUMENT
else
(
nextb
()
|
(
nextb
()
<<
8
))))
(
nextb
()
|
(
nextb
()
<<
8
))))
for
c
in
ordit
)
for
oparg1
,
oparg2
,
(
op3
,
arg3
)
in
itertools
.
izip
(
opit
,
opit
,
opit
):
opit
,
opit2
,
opit3
=
itertools
.
tee
(
opit
,
3
)
next
(
opit2
)
next
(
opit3
)
next
(
opit3
)
for
oparg1
,
oparg2
,
(
op3
,
arg3
)
in
itertools
.
izip
(
opit
,
opit2
,
opit3
):
if
op3
==
IMPORT_NAME
:
op2
,
arg2
=
oparg2
op1
,
arg1
=
oparg1
if
op1
==
op2
==
LOAD_CONST
:
yield
(
co
.
co_consts
[
arg1
],
co
.
co_names
[
arg3
],
co
.
co_consts
[
arg2
]
or
(),
)
yield
(
co
.
co_consts
[
arg1
],
co
.
co_names
[
arg3
],
co
.
co_consts
[
arg2
]
or
())
class
LogForwarder
(
object
):
...
...
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