Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Kirill Smelkov
gevent
Commits
4d5f888e
Commit
4d5f888e
authored
Apr 22, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Greenlet: use _formatinfo() method rather than _formatted_info property
parent
3e375b6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
gevent/greenlet.py
gevent/greenlet.py
+10
-4
No files found.
gevent/greenlet.py
View file @
4d5f888e
...
...
@@ -170,13 +170,16 @@ class Greenlet(greenlet):
def
__repr__
(
self
):
classname
=
self
.
__class__
.
__name__
result
=
'<%s at %s'
%
(
classname
,
hex
(
id
(
self
)))
formatted
=
self
.
_format
ted_info
if
formatted
is
not
None
:
formatted
=
self
.
_format
info
()
if
formatted
:
result
+=
': '
+
formatted
return
result
+
'>'
@
lazy_property
def
_formatted_info
(
self
):
def
_formatinfo
(
self
):
try
:
return
self
.
_formatted_info
except
AttributeError
:
pass
try
:
result
=
getfuncname
(
self
.
__dict__
[
'_run'
])
except
Exception
:
...
...
@@ -189,7 +192,10 @@ class Greenlet(greenlet):
args
.
extend
([
'%s=%r'
%
x
for
x
in
self
.
kwargs
.
items
()])
if
args
:
result
+=
'('
+
', '
.
join
(
args
)
+
')'
# it is important to save the result here, because once the greenlet exits '_run' attribute will be removed
self
.
_formatted_info
=
result
return
result
return
''
@
property
def
exception
(
self
):
...
...
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