]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Remove redundant 3.6 code and bump mypy's python_version to 3.7 (#3313)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Fri, 7 Oct 2022 00:37:37 +0000 (17:37 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Oct 2022 00:37:37 +0000 (17:37 -0700)
autoload/black.vim
mypy.ini
src/black/__init__.py
src/black/concurrency.py
src/black/parsing.py

index e87a1e4edfa09783f70842e47aa2bd1a30a4188f..eec446379503873f0fc38ab93edf45dbfb830708 100644 (file)
@@ -57,8 +57,8 @@ def _get_virtualenv_site_packages(venv_path, pyver):
 
 def _initialize_black_env(upgrade=False):
   pyver = sys.version_info[:3]
-  if pyver < (3, 6, 2):
-    print("Sorry, Black requires Python 3.6.2+ to run.")
+  if pyver < (3, 7):
+    print("Sorry, Black requires Python 3.7+ to run.")
     return False
 
   from pathlib import Path
index 4811cc0be76f86accfe95a035e24a0ee464e1a8b..58bb75361730a68c3fa4d7b27b20a70189b26655 100644 (file)
--- a/mypy.ini
+++ b/mypy.ini
@@ -2,7 +2,7 @@
 # Specify the target platform details in config, so your developers are
 # free to run mypy on Windows, Linux, or macOS and get consistent
 # results.
-python_version=3.6
+python_version=3.7
 
 mypy_path=src
 
@@ -19,11 +19,6 @@ no_implicit_reexport = False
 # to avoid 'em in the first place.
 warn_unreachable=True
 
-[mypy-black]
-# The following is because of `patch_click()`. Remove when
-# we drop Python 3.6 support.
-warn_unused_ignores=False
-
 [mypy-blib2to3.driver.*]
 ignore_missing_imports = True
 
index afd71e519162eeda6643aa3ff22ca9e9b060f6af..5293796aea1cecac7dc83f994ed4a1ecfa3b47bb 100644 (file)
@@ -1382,9 +1382,9 @@ def patch_click() -> None:
 
     for module in modules:
         if hasattr(module, "_verify_python3_env"):
-            module._verify_python3_env = lambda: None  # type: ignore
+            module._verify_python3_env = lambda: None
         if hasattr(module, "_verify_python_env"):
-            module._verify_python_env = lambda: None  # type: ignore
+            module._verify_python_env = lambda: None
 
 
 def patched_main() -> None:
index 10e288f4f93573ce6f6e599eb0da808f406b6de5..1598f51e43f5a08b4ed428ebb15413798a0e3991 100644 (file)
@@ -47,12 +47,8 @@ def cancel(tasks: Iterable["asyncio.Task[Any]"]) -> None:
 def shutdown(loop: asyncio.AbstractEventLoop) -> None:
     """Cancel all pending tasks on `loop`, wait for them, and close the loop."""
     try:
-        if sys.version_info[:2] >= (3, 7):
-            all_tasks = asyncio.all_tasks
-        else:
-            all_tasks = asyncio.Task.all_tasks
         # This part is borrowed from asyncio/runners.py in Python 3.7b2.
-        to_cancel = [task for task in all_tasks(loop) if not task.done()]
+        to_cancel = [task for task in asyncio.all_tasks(loop) if not task.done()]
         if not to_cancel:
             return
 
index 64c0b1e30183fda1e711c27bda48264cba4e000d..f7d9fdc2f134f8689f25e4f1d67ab4bb415546bb 100644 (file)
@@ -27,8 +27,7 @@ _IS_PYPY = platform.python_implementation() == "PyPy"
 try:
     from typed_ast import ast3
 except ImportError:
-    # Either our python version is too low, or we're on pypy
-    if sys.version_info < (3, 7) or (sys.version_info < (3, 8) and not _IS_PYPY):
+    if sys.version_info < (3, 8) and not _IS_PYPY:
         print(
             "The typed_ast package is required but not installed.\n"
             "You can upgrade to Python 3.8+ or install typed_ast with\n"