Skip to content

Commit 07a78bd

Browse files
committed
get_help_record not abstract, return None instead of pass so linter doesn't complain,
add abc allowed import.
1 parent ba17a2d commit 07a78bd

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/click/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,8 +2349,8 @@ def handle_parse_result(
23492349

23502350
return value, args
23512351

2352-
@abstractmethod
2353-
def get_help_record(self, ctx: Context) -> tuple[str, str] | None: ...
2352+
def get_help_record(self, ctx: Context) -> tuple[str, str] | None:
2353+
return None
23542354

23552355
def get_usage_pieces(self, ctx: Context) -> list[str]:
23562356
return []

tests/test_imports.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,29 @@ def tracking_import(module, locals=None, globals=None, fromlist=None,
2727

2828
ALLOWED_IMPORTS = {
2929
"__future__",
30-
"weakref",
31-
"os",
32-
"struct",
33-
"collections",
30+
"abc",
31+
"codecs",
3432
"collections.abc",
35-
"sys",
33+
"collections",
3634
"contextlib",
35+
"datetime",
36+
"enum",
37+
"errno",
38+
"fcntl",
3739
"functools",
38-
"stat",
39-
"re",
40-
"codecs",
40+
"gettext",
4141
"inspect",
42-
"itertools",
4342
"io",
43+
"itertools",
44+
"os",
45+
"re",
46+
"stat",
47+
"struct",
48+
"sys",
4449
"threading",
45-
"errno",
46-
"fcntl",
47-
"datetime",
48-
"enum",
49-
"typing",
5050
"types",
51-
"gettext",
51+
"typing",
52+
"weakref",
5253
}
5354

5455
if WIN:

0 commit comments

Comments
 (0)