Skip to content

Commit

Permalink
fix: Python 3.11 breaks f-String cast
Browse files Browse the repository at this point in the history
From What’s New In Python 3.11:

> Changed Enum.format() (the default for format(), str.format() and f-strings)
to always produce the same result as Enum.str(): for enums inheriting from ReprEnum
it will be the member’s value; __for all other enums it will be the enum and member
name (e.g. Color.RED).__

For this reason we specifically use the enum's value where necessary.

Fixes #9
  • Loading branch information
KAUTH committed Jan 15, 2024
1 parent 318fb5d commit c0195aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auto_click_auto/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def enable_click_shell_completion(
for shell in shells:

if shell in (ShellType.BASH, ShellType.ZSH):
shell_config_file = os.path.expanduser(f"~/.{shell}rc")
shell_config_file = os.path.expanduser(f"~/.{shell.value}rc")

# Completion implementation: `eval` command in shell configuration
eval_command = (
Expand Down Expand Up @@ -105,7 +105,7 @@ def enable_click_shell_completion(

elif shell == ShellType.FISH:
completer_script_path = os.path.expanduser(
f"~/.config/fish/completions/{program_name}.{shell}"
f"~/.config/fish/completions/{program_name}.{shell.value}"
)

# bash and zsh config files are generic, so we can assume the user
Expand Down

0 comments on commit c0195aa

Please sign in to comment.