Skip to content

Commit

Permalink
Remove deprecated use of .settings and .errors in h2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwlchan committed Mar 23, 2017
1 parent 20c2480 commit 8b16ae2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/twisted/python/_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
'pyobjc-framework-CFNetwork',
'pyobjc-framework-Cocoa'],
windows=['pypiwin32'],
http2=['h2 >= 2.5.0, < 3.0',
http2=['h2 >= 2.6.0, < 3.0',
'priority >= 1.1.0, < 2.0'],
)

Expand Down
4 changes: 2 additions & 2 deletions src/twisted/web/_http2.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def timeoutConnection(self):
# NO_ERROR.
if (self.conn.open_outbound_streams > 0 or
self.conn.open_inbound_streams > 0):
error_code = h2.errors.PROTOCOL_ERROR
error_code = h2.errors.ErrorCodes.PROTOCOL_ERROR
else:
error_code = h2.errors.NO_ERROR
error_code = h2.errors.ErrorCodes.NO_ERROR

self.conn.close_connection(error_code=error_code)
self.transport.write(self.conn.data_to_send())
Expand Down
12 changes: 6 additions & 6 deletions src/twisted/web/test/test_http2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ def test_delayWrites(self):

requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down Expand Up @@ -1429,7 +1429,7 @@ def test_bufferExcessData(self):
# Shrink the window to 5 bytes, then send the request.
requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down Expand Up @@ -1477,7 +1477,7 @@ def test_producerBlockingUnblocking(self):
# Shrink the window to 5 bytes, then send the request.
requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down Expand Up @@ -1575,7 +1575,7 @@ def test_flowControlExact(self):
# Shrink the window to 5 bytes, then send the request.
requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down Expand Up @@ -1649,7 +1649,7 @@ def test_endingBlockedStream(self):
# Shrink the window to 5 bytes, then send the request.
requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down Expand Up @@ -1835,7 +1835,7 @@ def test_producerUnblocked(self):
# Shrink the window to 5 bytes, then send the request.
requestBytes = f.clientConnectionPreface()
requestBytes += f.buildSettingsFrame(
{h2.settings.INITIAL_WINDOW_SIZE: 5}
{h2.settings.SettingCodes.INITIAL_WINDOW_SIZE: 5}
).serialize()
requestBytes += buildRequestBytes(
self.getRequestHeaders, [], f
Expand Down
Empty file.

0 comments on commit 8b16ae2

Please sign in to comment.