summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--logilab/common/graph.py5
-rw-r--r--logilab/common/modutils.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/logilab/common/graph.py b/logilab/common/graph.py
index d460692..8521cc6 100644
--- a/logilab/common/graph.py
+++ b/logilab/common/graph.py
@@ -300,7 +300,10 @@ def _get_cycles(
cycle.insert(0, node)
# make a canonical representation
- start_from = min(cycle)
+ # mypy: error: Value of type variable "_LT" of "min" cannot be "V"
+ # XXX I have no idea what this exactly mean here... we probably need to
+ # XXX tell that "V" supports "lower than" type of comparison but how?
+ start_from = min(cycle) # type: ignore
index = cycle.index(start_from)
cycle = cycle[index:] + cycle[0:index]
diff --git a/logilab/common/modutils.py b/logilab/common/modutils.py
index 6e65fb9..ca0b35a 100644
--- a/logilab/common/modutils.py
+++ b/logilab/common/modutils.py
@@ -198,7 +198,10 @@ def load_module_from_modpath(
if module is None:
mp_file, mp_filename, mp_desc = find_module(part, path)
try:
- module = load_module(curname, mp_file, mp_filename, mp_desc)
+ # mypy: Argument 2 to "load_module" has incompatible type "IO[Any]";
+ # mypy: expected "Optional[_FileLike]"
+ # this is handled by the try/finally somehow?
+ module = load_module(curname, mp_file, mp_filename, mp_desc) # type: ignore
finally:
if mp_file is not None:
mp_file.close()