diff --git a/hyper/http20/connection.py b/hyper/http20/connection.py index b8be292b..c6df953f 100644 --- a/hyper/http20/connection.py +++ b/hyper/http20/connection.py @@ -7,7 +7,7 @@ """ import h2.connection import h2.events -import h2.settings +from h2.settings import SettingCodes from ..compat import ssl from ..tls import wrap_socket, H2_NPN_PROTOCOLS, H2C_PROTOCOL @@ -403,7 +403,7 @@ def _connect_upgrade(self, sock): with self._conn as conn: conn.initiate_upgrade_connection() conn.update_settings( - {h2.settings.ENABLE_PUSH: int(self._enable_push)} + {SettingCodes.ENABLE_PUSH: int(self._enable_push)} ) self._send_outstanding_data() @@ -424,7 +424,7 @@ def _send_preamble(self): with self._conn as conn: conn.initiate_connection() conn.update_settings( - {h2.settings.ENABLE_PUSH: int(self._enable_push)} + {SettingCodes.ENABLE_PUSH: int(self._enable_push)} ) self._send_outstanding_data() diff --git a/test/test_hyper.py b/test/test_hyper.py index b826c63c..9b220ca3 100644 --- a/test/test_hyper.py +++ b/test/test_hyper.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -import h2.settings - from h2.frame_buffer import FrameBuffer from h2.connection import ConnectionState +from h2.settings import SettingCodes from hyperframe.frame import ( Frame, DataFrame, RstStreamFrame, SettingsFrame, PushPromiseFrame, WindowUpdateFrame, HeadersFrame, ContinuationFrame, GoAwayFrame, @@ -766,7 +765,7 @@ def test_incrementing_window_after_close(self): # the default max frame size (16,384 bytes). That will, on the third # frame, trigger the processing to increment the flow control window, # which should then not happen. - f = SettingsFrame(0, settings={h2.settings.INITIAL_WINDOW_SIZE: 100}) + f = SettingsFrame(0, settings={SettingCodes.INITIAL_WINDOW_SIZE: 100}) c = HTTP20Connection('www.google.com') c._sock = DummySocket()