Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
c4d1cd1c
Commit
c4d1cd1c
authored
6 years ago
by
William D. Jones
Committed by
Sébastien Bourdeauducq
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fhdl/tracer: support Python 3.6. Closes #62. (#98)
parent
e7ed194d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
migen/fhdl/tracer.py
migen/fhdl/tracer.py
+19
-10
No files found.
migen/fhdl/tracer.py
View file @
c4d1cd1c
import
inspect
import
inspect
from
sys
import
version_info
from
opcode
import
opname
from
opcode
import
opname
from
collections
import
defaultdict
from
collections
import
defaultdict
# All opcodes are 2 bytes in length in Python 3.6
def
_bytecode_length_version_guard
(
old_len
):
return
old_len
if
version_info
[
1
]
<
6
else
2
_call_opcodes
=
{
_call_opcodes
=
{
"CALL_FUNCTION"
:
3
,
"CALL_FUNCTION"
:
_bytecode_length_version_guard
(
3
),
"CALL_FUNCTION_VAR"
:
3
,
"CALL_FUNCTION_KW"
:
_bytecode_length_version_guard
(
3
),
"CALL_FUNCTION_KW"
:
3
,
"CALL_FUNCTION_VAR_KW"
:
3
,
}
}
if
version_info
[
1
]
<
6
:
_call_opcodes
[
"CALL_FUNCTION_VAR"
]
=
3
_call_opcodes
[
"CALL_FUNCTION_VAR_KW"
]
=
3
else
:
_call_opcodes
[
"CALL_FUNCTION_EX"
]
=
2
_load_build_opcodes
=
{
_load_build_opcodes
=
{
"LOAD_GLOBAL"
:
3
,
"LOAD_GLOBAL"
:
_bytecode_length_version_guard
(
3
)
,
"LOAD_ATTR"
:
3
,
"LOAD_ATTR"
:
_bytecode_length_version_guard
(
3
)
,
"LOAD_FAST"
:
3
,
"LOAD_FAST"
:
_bytecode_length_version_guard
(
3
)
,
"LOAD_DEREF"
:
3
,
"LOAD_DEREF"
:
_bytecode_length_version_guard
(
3
)
,
"DUP_TOP"
:
1
,
"DUP_TOP"
:
_bytecode_length_version_guard
(
1
)
,
"BUILD_LIST"
:
3
,
"BUILD_LIST"
:
_bytecode_length_version_guard
(
3
)
,
}
}
...
...
This diff is collapsed.
Click to expand it.
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