Skip to content

Commit a0f4594

Browse files
committed
Fixed deprecation warning about @no_type_check_decorator on Python 3.13
Fixes #414.
1 parent 286f86d commit a0f4594

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", pypy-3.10]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pretty = true
9898
[tool.tox]
9999
legacy_tox_ini = """
100100
[tox]
101-
envlist = pypy3, py38, py39, py310, py311, py312
101+
envlist = pypy3, py38, py39, py310, py311, py312, py313
102102
skip_missing_interpreters = true
103103
minversion = 4.0
104104

tests/dummymodule.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,17 @@
4040
P = ParamSpec("P")
4141

4242

43-
@no_type_check_decorator
44-
def dummy_decorator(func):
45-
return func
43+
if sys.version_info <= (3, 13):
44+
45+
@no_type_check_decorator
46+
def dummy_decorator(func):
47+
return func
48+
49+
@dummy_decorator
50+
def non_type_checked_decorated_func(x: int, y: str) -> 6:
51+
# This is to ensure that we avoid using a local variable that's already in use
52+
_call_memo = "foo" # noqa: F841
53+
return "foo"
4654

4755

4856
@typechecked
@@ -55,13 +63,6 @@ def non_type_checked_func(x: int, y: str) -> 6:
5563
return "foo"
5664

5765

58-
@dummy_decorator
59-
def non_type_checked_decorated_func(x: int, y: str) -> 6:
60-
# This is to ensure that we avoid using a local variable that's already in use
61-
_call_memo = "foo" # noqa: F841
62-
return "foo"
63-
64-
6566
@typeguard_ignore
6667
def non_typeguard_checked_func(x: int, y: str) -> 6:
6768
return "foo"

0 commit comments

Comments
 (0)