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
c406d5cd
Commit
c406d5cd
authored
Aug 25, 2018
by
Serhiy Storchaka
Committed by
GitHub
Aug 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)
parent
8fdd331b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Lib/test/test_trace.py
Lib/test/test_trace.py
+5
-0
Lib/trace.py
Lib/trace.py
+4
-10
Misc/NEWS.d/next/Library/2018-08-21-00-29-01.bpo-34171.6LkWav.rst
...S.d/next/Library/2018-08-21-00-29-01.bpo-34171.6LkWav.rst
+1
-0
No files found.
Lib/test/test_trace.py
View file @
c406d5cd
...
...
@@ -387,6 +387,11 @@ class TestCoverageCommandLineOutput(unittest.TestCase):
def
test_cover_files_written_no_highlight
(
self
):
argv
=
'-m trace --count'
.
split
()
+
[
self
.
codefile
]
status
,
stdout
,
stderr
=
assert_python_ok
(
*
argv
)
self
.
assertEqual
(
stderr
,
b''
)
tracedir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
trace
.
__file__
))
tracecoverpath
=
os
.
path
.
join
(
tracedir
,
"trace.cover"
)
self
.
assertFalse
(
os
.
path
.
exists
(
tracecoverpath
))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
coverfile
))
with
open
(
self
.
coverfile
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
...
...
Lib/trace.py
View file @
c406d5cd
...
...
@@ -63,14 +63,6 @@ from time import monotonic as _time
import
threading
def
_settrace
(
func
):
threading
.
settrace
(
func
)
sys
.
settrace
(
func
)
def
_unsettrace
():
sys
.
settrace
(
None
)
threading
.
settrace
(
None
)
PRAGMA_NOCOVER
=
"#pragma NO COVER"
class
_Ignore
:
...
...
@@ -451,12 +443,14 @@ class Trace:
if
globals
is
None
:
globals
=
{}
if
locals
is
None
:
locals
=
{}
if
not
self
.
donothing
:
_settrace
(
self
.
globaltrace
)
threading
.
settrace
(
self
.
globaltrace
)
sys
.
settrace
(
self
.
globaltrace
)
try
:
exec
(
cmd
,
globals
,
locals
)
finally
:
if
not
self
.
donothing
:
_unsettrace
()
sys
.
settrace
(
None
)
threading
.
settrace
(
None
)
def
runfunc
(
self
,
func
,
*
args
,
**
kw
):
result
=
None
...
...
Misc/NEWS.d/next/Library/2018-08-21-00-29-01.bpo-34171.6LkWav.rst
0 → 100644
View file @
c406d5cd
Running the :mod:`trace` module no longer creates the ``trace.cover`` file.
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