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
6da6e6fd
Commit
6da6e6fd
authored
Oct 31, 2018
by
Jason Madden
Committed by
GitHub
Oct 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1299 from gevent/issue1295
Be more careful handling NOT_ERROR during interpreter shutdown.
parents
8181ce31
8b6f95cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
CHANGES.rst
CHANGES.rst
+3
-0
src/gevent/_ffi/loop.py
src/gevent/_ffi/loop.py
+5
-1
src/gevent/hub.py
src/gevent/hub.py
+9
-1
No files found.
CHANGES.rst
View file @
6da6e6fd
...
...
@@ -28,6 +28,9 @@
``AsyncEvent``. Note that the order in which semaphore links are
called is not specified. See :issue:`1287`, reported by Dan Milon.
- Improve safety of handling exceptions during interpreter shutdown.
See :issue:`1295` reported by BobDenar1212.
1.3.7 (2018-10-12)
==================
...
...
src/gevent/_ffi/loop.py
View file @
6da6e6fd
...
...
@@ -137,7 +137,11 @@ class AbstractCallbacks(object):
# Depending on when the exception happened, the watcher
# may or may not have been stopped. We need to make sure its
# memory stays valid so we can stop it at the ev level if needed.
the_watcher
.
loop
.
_keepaliveset
.
add
(
the_watcher
)
# If its loop is gone, it has already been stopped,
# see https://github.com/gevent/gevent/issues/1295 for a case where
# that happened
if
the_watcher
.
loop
is
not
None
:
the_watcher
.
loop
.
_keepaliveset
.
add
(
the_watcher
)
return
-
1
else
:
if
(
the_watcher
.
loop
is
not
None
...
...
src/gevent/hub.py
View file @
6da6e6fd
...
...
@@ -511,7 +511,9 @@ class Hub(WaitOperationsGreenlet):
# Unwrap any FileObjectThread we have thrown around sys.stderr
# (because it can't be used in the hub). Tricky because we are
# called in error situations when it's not safe to import.
stderr
=
sys
.
stderr
# Be careful not to access sys if we're in the process of interpreter
# shutdown.
stderr
=
sys
.
stderr
if
sys
else
None
# pylint:disable=using-constant-test
if
type
(
stderr
).
__name__
==
'FileObjectThread'
:
stderr
=
stderr
.
io
# pylint:disable=no-member
return
stderr
...
...
@@ -521,6 +523,12 @@ class Hub(WaitOperationsGreenlet):
# traceback.print_exception() as previous versions did.
# pylint:disable=no-member
errstream
=
self
.
exception_stream
if
not
errstream
:
# pragma: no cover
# If the error stream is gone, such as when the sys dict
# gets cleared during interpreter shutdown,
# don't cause follow-on errors.
# See https://github.com/gevent/gevent/issues/1295
return
if
value
is
None
:
errstream
.
write
(
'%s
\
n
'
%
type
.
__name__
)
...
...
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