Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 6756a64

Browse files
committed
Define our own ConnectionResetError for 2.7.
1 parent 564b2f9 commit 6756a64

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

hyper/http20/bufsocket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
process.
1212
"""
1313
import select
14+
from .exceptions import ConnectionResetError
1415

1516
class BufferedSocket(object):
1617
"""

hyper/http20/exceptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ class ProtocolError(HTTP20Error):
3939
The remote party violated the HTTP/2 protocol.
4040
"""
4141
pass
42+
43+
44+
# Create our own ConnectionResetError.
45+
try: # pragma: no cover
46+
ConnectionResetError = ConnectionResetError
47+
except NameError: # pragma: no cover
48+
class ConnectionResetError(Exception):
49+
"""
50+
A HTTP/2 connection was unexpectedly reset.
51+
"""

0 commit comments

Comments
 (0)