From 7fd659f0c4de7d676337861c23edc9e5ebd6de13 Mon Sep 17 00:00:00 2001 From: Jeppe Fihl-Pearson Date: Thu, 10 Feb 2022 15:24:34 +0000 Subject: [PATCH] fix: correct import to not reference `__init__` (#3241) * Correct import to not reference `__init__` This will otherwise bring up the following error from mypy when type checking a code base that import ddtrace: > Source file found twice under different module names: > "ddtrace.internal.utils" and "ddtrace.internal.utils.__init__" This error didn't occur with version 0.57.3 but did with 0.58.0. * Add entry for release notes * Update releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml Co-authored-by: Brett Langdon Co-authored-by: Brett Langdon (cherry picked from commit 8be9e2a7fe6f0e983a64b835404a6618f7ccad0f) --- ddtrace/utils/__init__.py | 4 ++-- releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml diff --git a/ddtrace/utils/__init__.py b/ddtrace/utils/__init__.py index 1674effdf8b..2c453431ce0 100644 --- a/ddtrace/utils/__init__.py +++ b/ddtrace/utils/__init__.py @@ -1,5 +1,5 @@ -from ..internal.utils.__init__ import ArgumentError # noqa -from ..internal.utils.__init__ import get_argument_value # noqa +from ..internal.utils import ArgumentError # noqa +from ..internal.utils import get_argument_value # noqa from ..internal.utils.deprecation import deprecation diff --git a/releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml b/releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml new file mode 100644 index 00000000000..19ab374571b --- /dev/null +++ b/releasenotes/notes/fix-utils-import-c0f574d76de77261.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixes import path to not reference ``__init__``. This could otherwise be a problem for ``mypy``.