Skip to content

Commit 8470777

Browse files
committed
improvement: teach mypy how to deal with wildcard-imported objects
By telling it where it's imported from in one case and telling it to ignore it in another.
1 parent c885781 commit 8470777

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

git/exc.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
""" Module containing all exceptions thrown throughout the git package, """
77

8+
from gitdb.exc import BadName # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
89
from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
910
from git.compat import safe_decode
1011

git/objects/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from .tree import *
1717
# Fix import dependency - add IndexObject to the util module, so that it can be
1818
# imported by the submodule.base
19-
smutil.IndexObject = IndexObject
20-
smutil.Object = Object
19+
smutil.IndexObject = IndexObject # type: ignore[attr-defined]
20+
smutil.Object = Object # type: ignore[attr-defined]
2121
del(smutil)
2222

2323
# must come after submodule was made available

0 commit comments

Comments
 (0)