Skip to content

Commit 48bd095

Browse files
committed
ignore kw_only on Python 3.9
1 parent 2d38751 commit 48bd095

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/h2/events.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from __future__ import annotations
1212

1313
import binascii
14+
import sys
1415
from dataclasses import dataclass
1516
from typing import TYPE_CHECKING
1617

@@ -23,6 +24,12 @@
2324
from .errors import ErrorCodes
2425

2526

27+
if sys.version_info < (3, 10): # pragma: no cover
28+
kw_only: dict[str, bool] = {}
29+
else: # pragma: no cover
30+
kw_only = {"kw_only": True}
31+
32+
2633
class Event:
2734
"""
2835
Base class for h2 events.
@@ -293,7 +300,7 @@ def __repr__(self) -> str:
293300
)
294301

295302

296-
@dataclass(kw_only=True)
303+
@dataclass(**kw_only)
297304
class WindowUpdated(Event):
298305
"""
299306
The WindowUpdated event is fired whenever a flow control window changes

0 commit comments

Comments
 (0)