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
04bb2f5f
Commit
04bb2f5f
authored
Nov 06, 2010
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10330: trace module can now be used with python built without threads.
parent
4483edc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
Lib/trace.py
Lib/trace.py
+18
-5
No files found.
Lib/trace.py
View file @
04bb2f5f
...
...
@@ -53,7 +53,6 @@ import linecache
import
os
import
re
import
sys
import
threading
import
time
import
token
import
tokenize
...
...
@@ -62,6 +61,22 @@ import gc
import
dis
import
pickle
try
:
import
threading
except
ImportError
:
_settrace
=
sys
.
settrace
def
_unsettrace
():
sys
.
settrace
(
None
)
else
:
def
_settrace
(
func
):
threading
.
settrace
(
func
)
sys
.
settrace
(
func
)
def
_unsettrace
():
sys
.
settrace
(
None
)
threading
.
settrace
(
None
)
def
usage
(
outfile
):
outfile
.
write
(
"""Usage: %s [OPTIONS] <file> [ARGS]
...
...
@@ -491,14 +506,12 @@ class Trace:
if
globals
is
None
:
globals
=
{}
if
locals
is
None
:
locals
=
{}
if
not
self
.
donothing
:
threading
.
settrace
(
self
.
globaltrace
)
sys
.
settrace
(
self
.
globaltrace
)
_settrace
(
self
.
globaltrace
)
try
:
exec
(
cmd
,
globals
,
locals
)
finally
:
if
not
self
.
donothing
:
sys
.
settrace
(
None
)
threading
.
settrace
(
None
)
_unsettrace
()
def
runfunc
(
self
,
func
,
*
args
,
**
kw
):
result
=
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