Skip to content

Commit 14ed005

Browse files
committed
[bugfix] Fix issue with Python 3.10 and latest click
1 parent 76fb858 commit 14ed005

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scenedetect/_cli/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import os
2424
import os.path
2525
import typing as ty
26-
from copy import deepcopy
26+
from copy import copy
2727

2828
import click
2929

@@ -391,7 +391,9 @@ def scenedetect(
391391

392392
def add_hidden_alias(command: click.Command, alias: str):
393393
"""Adds a copy of `command` that can be invoked under the name `alias`."""
394-
hidden_command = deepcopy(command)
394+
# Shallow copy: deepcopy fails on Python 3.10 + click >=8.3 because click's internal
395+
# `Sentinel` enum values are not deepcopy-safe.
396+
hidden_command = copy(command)
395397
hidden_command.hidden = True
396398
scenedetect.add_command(hidden_command, alias)
397399

0 commit comments

Comments
 (0)