Skip to content

Commit

Permalink
get_help_record not abstract, return None instead of pass so linter d…
Browse files Browse the repository at this point in the history
…oesn't complain,

add abc allowed import.
  • Loading branch information
AndreasBackx committed Nov 9, 2024
1 parent 3cc11cc commit c40f6d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/click/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2349,8 +2349,8 @@ def handle_parse_result(

return value, args

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

def get_usage_pieces(self, ctx: Context) -> list[str]:
return []
Expand Down
31 changes: 16 additions & 15 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,29 @@ def tracking_import(module, locals=None, globals=None, fromlist=None,

ALLOWED_IMPORTS = {
"__future__",
"weakref",
"os",
"struct",
"collections",
"abc",
"codecs",
"collections.abc",
"sys",
"collections",
"contextlib",
"datetime",
"enum",
"errno",
"fcntl",
"functools",
"stat",
"re",
"codecs",
"gettext",
"inspect",
"itertools",
"io",
"itertools",
"os",
"re",
"stat",
"struct",
"sys",
"threading",
"errno",
"fcntl",
"datetime",
"enum",
"typing",
"types",
"gettext",
"typing",
"weakref",
}

if WIN:
Expand Down

0 comments on commit c40f6d3

Please sign in to comment.