Skip to content

Commit d2bc6d2

Browse files
committed
Fix new final decorator test.
1 parent fcfb294 commit d2bc6d2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

jsonargparse/_optionals.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ class FinalClass:
7171
return getattr(FinalClass, "__final__", False) # __final__ available in stdlib from python 3.11
7272

7373

74+
fallback_final = final
7475
stdlib_final = typing_extensions_import("final")
7576
if stdlib_final and is_compatible_final(stdlib_final) and "SPHINX_BUILD" not in os.environ:
76-
final = stdlib_final # noqa: F811
77+
final = stdlib_final
7778

7879

7980
def import_typeshed_client():

jsonargparse_tests/test_optionals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from jsonargparse._optionals import (
99
_get_config_read_mode,
1010
docstring_parser_support,
11-
final,
11+
fallback_final,
1212
fsspec_support,
1313
get_docstring_parse_options,
1414
import_docstring_parser,
@@ -185,7 +185,7 @@ def test_config_read_mode_fsspec_support_false():
185185
# final decorator tests
186186

187187

188-
@final
188+
@fallback_final
189189
class FinalClass:
190190
pass
191191

0 commit comments

Comments
 (0)