Skip to content

Commit 39748b2

Browse files
chore(typing): update types to be compatible with mypy 0.990 (backport #4495) (#4498)
* fix(typing): update types to be compatible with mypy 0.990 (#4495) mypy 0.990 was released which breaks some of our type ignores. Some are no longer necessary, others require a different type of ignore. (cherry picked from commit 747c036) Co-authored-by: Kyle Verhoog <[email protected]>
1 parent 9ec5c74 commit 39748b2

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

ddtrace/debugging/_function/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
try:
1515
from typing import Protocol
1616
except ImportError:
17-
from typing_extensions import Protocol # type: ignore[misc]
17+
from typing_extensions import Protocol # type: ignore[assignment]
1818

1919
from os.path import abspath
2020
from types import FunctionType

ddtrace/internal/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_logger(name):
4949
# https://github.com/python/cpython/blob/7c7839329c2c66d051960ab1df096aed1cc9343e/Lib/logging/__init__.py#L1272-L1294 # noqa
5050
# DEV: `_fixupParents` has been around for awhile, but add the `hasattr` guard... just in case.
5151
if hasattr(manager, "_fixupParents"):
52-
manager._fixupParents(logger) # type: ignore[attr-defined]
52+
manager._fixupParents(logger)
5353

5454
# Return our logger
5555
return logger

ddtrace/internal/wrapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
try:
1414
from typing import Protocol
1515
except ImportError:
16-
from typing_extensions import Protocol # type: ignore[misc]
16+
from typing_extensions import Protocol # type: ignore[assignment]
1717

1818
from bytecode import Bytecode
1919
from bytecode import Compare

ddtrace/profiling/_asyncio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def set_event_loop_policy(loop_policy):
2828
if hasattr(asyncio, "current_task"):
2929
current_task = asyncio.current_task
3030
elif hasattr(asyncio.Task, "current_task"):
31-
current_task = asyncio.Task.current_task # type: ignore[attr-defined]
31+
current_task = asyncio.Task.current_task
3232
else:
3333

3434
def current_task(loop=None):
@@ -37,7 +37,7 @@ def current_task(loop=None):
3737
if hasattr(asyncio, "all_tasks"):
3838
all_tasks = asyncio.all_tasks
3939
elif hasattr(asyncio.Task, "all_tasks"):
40-
all_tasks = asyncio.Task.all_tasks # type: ignore[attr-defined]
40+
all_tasks = asyncio.Task.all_tasks
4141
else:
4242

4343
def all_tasks(loop=None):

ddtrace/profiling/exporter/pprof.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class pprof_ProfileType(object):
170170
string_table: typing.Dict[int, str]
171171
mapping: typing.List[pprof_Mapping]
172172

173-
def SerializeToString(self) -> bytes:
173+
def SerializeToString(self) -> bytes: # type: ignore[empty-body]
174174
...
175175

176176

0 commit comments

Comments
 (0)