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
1750f7aa
Commit
1750f7aa
authored
Apr 07, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pretty-print the 'where' object in error report
parent
413abfed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
gevent/hub.py
gevent/hub.py
+8
-0
No files found.
gevent/hub.py
View file @
1750f7aa
...
...
@@ -194,6 +194,7 @@ class Hub(greenlet):
SYSTEM_ERROR
=
(
KeyboardInterrupt
,
SystemExit
,
SystemError
)
loop_class
=
'gevent.core.loop'
pformat
=
'pprint.pformat'
def
__init__
(
self
,
loop
=
None
,
default
=
None
):
greenlet
.
__init__
(
self
)
...
...
@@ -207,6 +208,7 @@ class Hub(greenlet):
loop_class
=
_import
(
self
.
loop_class
)
self
.
loop
=
loop_class
(
flags
=
loop
,
default
=
default
)
self
.
loop
.
error_handler
=
self
self
.
pformat
=
_import
(
self
.
pformat
)
def
handle_error
(
self
,
where
,
type
,
value
,
tb
):
traceback
.
print_exception
(
type
,
value
,
tb
)
...
...
@@ -217,6 +219,12 @@ class Hub(greenlet):
else
:
self
.
loop
.
run_callback
(
self
.
parent
.
throw
,
type
,
value
)
else
:
if
not
isinstance
(
where
,
str
):
try
:
where
=
self
.
pformat
(
where
)
except
:
traceback
.
print_exc
()
where
=
repr
(
where
)
sys
.
stderr
.
write
(
'Ignoring %s in %s
\
n
\
n
'
%
(
getattr
(
type
,
'__name__'
,
'exception'
),
where
,
))
def
switch
(
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