Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
10e9b726
Commit
10e9b726
authored
Feb 05, 2008
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change r60575 broke test_compile:
there is no need to emit co_lnotab item when both offsets are zeros.
parent
d622d7db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/test/test_trace.py
Lib/test/test_trace.py
+9
-0
Python/compile.c
Python/compile.c
+3
-0
No files found.
Lib/test/test_trace.py
View file @
10e9b726
...
@@ -366,6 +366,15 @@ class TraceTestCase(unittest.TestCase):
...
@@ -366,6 +366,15 @@ class TraceTestCase(unittest.TestCase):
(
3
,
'line'
),
(
3
,
'line'
),
(
3
,
'return'
)])
(
3
,
'return'
)])
def
test_16_blank_lines
(
self
):
exec
(
"def f():
\
n
"
+
"
\
n
"
*
256
+
" pass"
)
self
.
run_and_compare
(
f
,
[(
0
,
'call'
),
(
257
,
'line'
),
(
257
,
'return'
)])
class
RaisingTraceFuncTestCase
(
unittest
.
TestCase
):
class
RaisingTraceFuncTestCase
(
unittest
.
TestCase
):
def
trace
(
self
,
frame
,
event
,
arg
):
def
trace
(
self
,
frame
,
event
,
arg
):
"""A trace function that raises an exception in response to a
"""A trace function that raises an exception in response to a
...
...
Python/compile.c
View file @
10e9b726
...
@@ -3560,6 +3560,9 @@ assemble_lnotab(struct assembler *a, struct instr *i)
...
@@ -3560,6 +3560,9 @@ assemble_lnotab(struct assembler *a, struct instr *i)
assert
(
d_bytecode
>=
0
);
assert
(
d_bytecode
>=
0
);
assert
(
d_lineno
>=
0
);
assert
(
d_lineno
>=
0
);
if
(
d_bytecode
==
0
&&
d_lineno
==
0
)
return
1
;
if
(
d_bytecode
>
255
)
{
if
(
d_bytecode
>
255
)
{
int
j
,
nbytes
,
ncodes
=
d_bytecode
/
255
;
int
j
,
nbytes
,
ncodes
=
d_bytecode
/
255
;
nbytes
=
a
->
a_lnotab_off
+
2
*
ncodes
;
nbytes
=
a
->
a_lnotab_off
+
2
*
ncodes
;
...
...
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