From: Michael R. Crusoe <crusoe@debian.org>
Subject: accept pathspec v1
Forwarded: not-needed

Adapted from https://github.com/python/mypy/commit/7fee02ca109ad511bb55efd83ec13efc7f7eabfb
--- mypy.orig/mypy/modulefinder.py
+++ mypy/mypy/modulefinder.py
@@ -17,7 +17,10 @@
 from typing_extensions import TypeAlias as _TypeAlias
 
 from pathspec import PathSpec
-from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
+try:
+    from pathspec.patterns.gitignore import GitIgnorePatternError  # type: ignore[import-not-found]
+except ImportError:
+    from pathspec.patterns.gitwildmatch import GitWildMatchPatternError as GitIgnorePatternError  # type: ignore[attr-defined]
 
 from mypy import pyinfo
 from mypy.errors import CompileError
@@ -740,7 +743,7 @@
             lines = f.readlines()
         try:
             return parent_gitignores + [(dir, PathSpec.from_lines("gitwildmatch", lines))]
-        except GitWildMatchPatternError:
+        except GitIgnorePatternError:
             print(f"error: could not parse {gitignore}", file=sys.stderr)
             return parent_gitignores
     return parent_gitignores
--- mypy.orig/mypy_self_check.ini
+++ mypy/mypy_self_check.ini
@@ -14,3 +14,4 @@
 show_error_code_links = True
 warn_unreachable = True
 fixed_format_cache = True
+warn_unused_ignores = False
