Skip to content

Commit 1a077b9

Browse files
committed
Finish removing support for 3.10
1 parent fd66b04 commit 1a077b9

6 files changed

Lines changed: 8 additions & 30 deletions

File tree

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3114,7 +3114,7 @@ def _complete_statement(self, line: str) -> Statement:
31143114
while True:
31153115
try:
31163116
return self._check_statement_complete(line)
3117-
except IncompleteStatement: # noqa: PERF203
3117+
except IncompleteStatement:
31183118
# If incomplete, we need to fetch the next line
31193119
try:
31203120
try:

cmd2/colors.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
"""Provides a convenient StrEnum for Rich color names."""
22

3-
import sys
4-
5-
if sys.version_info >= (3, 11):
6-
from enum import StrEnum
7-
else:
8-
from backports.strenum import StrEnum
3+
from enum import StrEnum
94

105

116
class Color(StrEnum):

cmd2/completion.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import copy
44
import re
5-
import sys
65
from collections.abc import (
76
Iterable,
87
Iterator,
@@ -14,22 +13,16 @@
1413
)
1514
from typing import (
1615
Any,
16+
Self,
1717
cast,
1818
overload,
1919
)
2020

21-
from rich.table import Table
22-
23-
from . import string_utils as su
24-
25-
if sys.version_info >= (3, 11):
26-
from typing import Self
27-
else:
28-
from typing_extensions import Self
29-
3021
from rich.protocol import is_renderable
22+
from rich.table import Table
3123

3224
from . import rich_utils as ru
25+
from . import string_utils as su
3326

3427

3528
class _UnsetStr(str):

cmd2/parsing.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import re
44
import shlex
5-
import sys
65
from collections.abc import (
76
Iterable,
87
Mapping,
@@ -16,13 +15,9 @@
1615
from typing import (
1716
Any,
1817
ClassVar,
18+
Self,
1919
)
2020

21-
if sys.version_info >= (3, 11):
22-
from typing import Self
23-
else:
24-
from typing_extensions import Self
25-
2621
from . import (
2722
constants,
2823
utils,

cmd2/styles.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,14 @@
2626
https://github.com/prompt-toolkit/python-prompt-toolkit/blob/main/src/prompt_toolkit/styles/defaults.py
2727
"""
2828

29-
import sys
29+
from enum import StrEnum
3030

3131
from rich.style import (
3232
Style,
3333
StyleType,
3434
)
3535
from rich_argparse import RichHelpFormatter
3636

37-
if sys.version_info >= (3, 11):
38-
from enum import StrEnum
39-
else:
40-
from backports.strenum import StrEnum
41-
4237
from .colors import Color
4338

4439

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exclude = [
3131
# Same as Black.
3232
line-length = 127
3333
indent-width = 4
34-
target-version = "py310" # Minimum supported version of Python
34+
target-version = "py311" # Minimum supported version of Python
3535
output-format = "full"
3636

3737
[lint]

0 commit comments

Comments
 (0)