Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
erp5
Commits
2b7430ef
Commit
2b7430ef
authored
Apr 17, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sys._current_frames instead of threadframe.
One dependency less.
parent
ea406275
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
product/DeadlockDebugger/dumper.py
product/DeadlockDebugger/dumper.py
+2
-4
No files found.
product/DeadlockDebugger/dumper.py
View file @
2b7430ef
...
@@ -23,7 +23,7 @@ ZServer hook to dump a traceback of the running python threads.
...
@@ -23,7 +23,7 @@ ZServer hook to dump a traceback of the running python threads.
"""
"""
import
thread
import
thread
import
threadframe
from
sys
import
_current_frames
import
traceback
import
traceback
import
time
import
time
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
...
@@ -36,11 +36,10 @@ def dump_threads():
...
@@ -36,11 +36,10 @@ def dump_threads():
Returns a string with the tracebacks.
Returns a string with the tracebacks.
"""
"""
frames
=
threadframe
.
dict
()
this_thread_id
=
thread
.
get_ident
()
this_thread_id
=
thread
.
get_ident
()
now
=
time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
now
=
time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
res
=
[
"Threads traceback dump at %s
\
n
"
%
now
]
res
=
[
"Threads traceback dump at %s
\
n
"
%
now
]
for
thread_id
,
frame
in
frames
.
iteritems
():
for
thread_id
,
frame
in
_current_frames
()
.
iteritems
():
if
thread_id
==
this_thread_id
:
if
thread_id
==
this_thread_id
:
continue
continue
...
@@ -68,7 +67,6 @@ def dump_threads():
...
@@ -68,7 +67,6 @@ def dump_threads():
res
.
append
(
"Thread %s%s:
\
n
%s"
%
res
.
append
(
"Thread %s%s:
\
n
%s"
%
(
thread_id
,
reqinfo
,
output
.
getvalue
()))
(
thread_id
,
reqinfo
,
output
.
getvalue
()))
frames
=
None
res
.
append
(
"End of dump"
)
res
.
append
(
"End of dump"
)
result
=
'
\
n
'
.
join
(
res
)
result
=
'
\
n
'
.
join
(
res
)
if
isinstance
(
result
,
unicode
):
if
isinstance
(
result
,
unicode
):
...
...
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