Skip to content

Commit 93cb982

Browse files
committed
Fixed missing dependency for Python 3.10
1 parent ec339de commit 93cb982

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.1.2 (January 26, 2026)
2+
3+
- Bug Fixes
4+
- Fixed missing `typing-extensions` dependency for Python 3.10
5+
16
## 3.1.1 (January 26, 2026)
27

38
- Bug Fixes

cmd2/argparse_custom.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ def get_items(self) -> list[CompletionItems]:
290290
RawTextRichHelpFormatter,
291291
RichHelpFormatter,
292292
)
293-
from typing_extensions import Self
293+
294+
if sys.version_info >= (3, 11):
295+
from typing import Self
296+
else:
297+
from typing_extensions import Self
298+
294299

295300
from . import constants
296301
from . import rich_utils as ru

cmd2/parsing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
import re
44
import shlex
5+
import sys
56
from collections.abc import Iterable
67
from dataclasses import (
78
dataclass,
89
field,
910
)
1011
from typing import Any
1112

12-
from typing_extensions import Self
13+
if sys.version_info >= (3, 11):
14+
from typing import Self
15+
else:
16+
from typing_extensions import Self
1317

1418
from . import (
1519
constants,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies = [
3535
"pyreadline3>=3.4; platform_system == 'Windows'",
3636
"rich>=14.3.0",
3737
"rich-argparse>=1.7.1",
38+
"typing-extensions; python_version == '3.10'",
3839
]
3940

4041
[dependency-groups]

0 commit comments

Comments
 (0)