]> 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:

Fix outdated references to 3.6 and run pyupgrade (#3286)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Mon, 26 Sep 2022 00:24:18 +0000 (20:24 -0400)
committerGitHub <noreply@github.com>
Mon, 26 Sep 2022 00:24:18 +0000 (17:24 -0700)
I also missed the accidental removal of the 3.11 classifier in the PR.

README.md
docs/getting_started.md
docs/integrations/editors.md
pyproject.toml
src/black/comments.py
src/black/concurrency.py
src/black/trans.py

index 4c76160651429a7421267e457f7abce1c55d93e2..b25930246768a95b78529233fe90a83576dee35f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -38,9 +38,8 @@ Try it out now using the [Black Playground](https://black.vercel.app). Watch the
 
 ### Installation
 
 
 ### Installation
 
-_Black_ can be installed by running `pip install black`. It requires Python 3.6.2+ to
-run. If you want to format Jupyter Notebooks, install with
-`pip install 'black[jupyter]'`.
+_Black_ can be installed by running `pip install black`. It requires Python 3.7+ to run.
+If you want to format Jupyter Notebooks, install with `pip install 'black[jupyter]'`.
 
 If you can't wait for the latest _hotness_ and want to install from GitHub, use:
 
 
 If you can't wait for the latest _hotness_ and want to install from GitHub, use:
 
index fca960915a844d78d997264a113addddba3e43c0..1825f3b5aa35921b26680977bf032b9e34680ff9 100644 (file)
@@ -16,9 +16,8 @@ Also, you can try out _Black_ online for minimal fuss on the
 
 ## Installation
 
 
 ## Installation
 
-_Black_ can be installed by running `pip install black`. It requires Python 3.6.2+ to
-run. If you want to format Jupyter Notebooks, install with
-`pip install 'black[jupyter]'`.
+_Black_ can be installed by running `pip install black`. It requires Python 3.7+ to run.
+If you want to format Jupyter Notebooks, install with `pip install 'black[jupyter]'`.
 
 If you can't wait for the latest _hotness_ and want to install from GitHub, use:
 
 
 If you can't wait for the latest _hotness_ and want to install from GitHub, use:
 
index 318e0e295d0567481cf9738e3f0680c058a9194d..28c9f48a09f29284304bb10e7baff1fe33c8eab5 100644 (file)
@@ -148,7 +148,7 @@ curl https://raw.githubusercontent.com/psf/black/stable/autoload/black.vim -o ~/
 Let me know if this requires any changes to work with Vim 8's builtin `packadd`, or
 Pathogen, and so on.
 
 Let me know if this requires any changes to work with Vim 8's builtin `packadd`, or
 Pathogen, and so on.
 
-This plugin **requires Vim 7.0+ built with Python 3.6+ support**. It needs Python 3.6 to
+This plugin **requires Vim 7.0+ built with Python 3.7+ support**. It needs Python 3.7 to
 be able to run _Black_ inside the Vim process which is much faster than calling an
 external command.
 
 be able to run _Black_ inside the Vim process which is much faster than calling an
 external command.
 
index c37702616fc9cde0176da27c8f095fca5dc7b042..412e46cbc05f327be163a9b6337d8ca8704bf5e2 100644 (file)
@@ -58,6 +58,7 @@ classifiers = [
   "Programming Language :: Python :: 3.8",
   "Programming Language :: Python :: 3.9",
   "Programming Language :: Python :: 3.10",
   "Programming Language :: Python :: 3.8",
   "Programming Language :: Python :: 3.9",
   "Programming Language :: Python :: 3.10",
+  "Programming Language :: Python :: 3.11",
   "Topic :: Software Development :: Libraries :: Python Modules",
   "Topic :: Software Development :: Quality Assurance",
 ]
   "Topic :: Software Development :: Libraries :: Python Modules",
   "Topic :: Software Development :: Quality Assurance",
 ]
index 2a4c254ecd9119b2796c7116d92890d94c024981..dce83abf1bbdba33bf8aa2eab9a3462b8c96a054 100644 (file)
@@ -270,8 +270,7 @@ def _generate_ignored_nodes_from_fmt_skip(
         while "\n" not in prev_sibling.prefix and prev_sibling.prev_sibling is not None:
             prev_sibling = prev_sibling.prev_sibling
             siblings.insert(0, prev_sibling)
         while "\n" not in prev_sibling.prefix and prev_sibling.prev_sibling is not None:
             prev_sibling = prev_sibling.prev_sibling
             siblings.insert(0, prev_sibling)
-        for sibling in siblings:
-            yield sibling
+        yield from siblings
     elif (
         parent is not None and parent.type == syms.suite and leaf.type == token.NEWLINE
     ):
     elif (
         parent is not None and parent.type == syms.suite and leaf.type == token.NEWLINE
     ):
index bdc368d5add243b17803fa7e6bb2ff23036c6411..10e288f4f93573ce6f6e599eb0da808f406b6de5 100644 (file)
@@ -58,12 +58,7 @@ def shutdown(loop: asyncio.AbstractEventLoop) -> None:
 
         for task in to_cancel:
             task.cancel()
 
         for task in to_cancel:
             task.cancel()
-        if sys.version_info >= (3, 7):
-            loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
-        else:
-            loop.run_until_complete(
-                asyncio.gather(*to_cancel, loop=loop, return_exceptions=True)
-            )
+        loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
     finally:
         # `concurrent.futures.Future` objects cannot be cancelled once they
         # are already running. There might be some when the `shutdown()` happened.
     finally:
         # `concurrent.futures.Future` objects cannot be cancelled once they
         # are already running. There might be some when the `shutdown()` happened.
@@ -191,9 +186,6 @@ async def schedule_formatting(
                     sources_to_cache.append(src)
                 report.done(src, changed)
     if cancelled:
                     sources_to_cache.append(src)
                 report.done(src, changed)
     if cancelled:
-        if sys.version_info >= (3, 7):
-            await asyncio.gather(*cancelled, return_exceptions=True)
-        else:
-            await asyncio.gather(*cancelled, loop=loop, return_exceptions=True)
+        await asyncio.gather(*cancelled, return_exceptions=True)
     if sources_to_cache:
         write_cache(cache, sources_to_cache, mode)
     if sources_to_cache:
         write_cache(cache, sources_to_cache, mode)
index 74b932bb42256d041de728a012de1d3349197bbc..7e2d8e67c1acc1ffee6196c9d822bfe9936ad66b 100644 (file)
@@ -1256,7 +1256,7 @@ class StringSplitter(BaseStringSplitter, CustomSplitMapMixin):
 
         string_op_leaves = self._get_string_operator_leaves(LL)
         string_op_leaves_length = (
 
         string_op_leaves = self._get_string_operator_leaves(LL)
         string_op_leaves_length = (
-            sum([len(str(prefix_leaf)) for prefix_leaf in string_op_leaves]) + 1
+            sum(len(str(prefix_leaf)) for prefix_leaf in string_op_leaves) + 1
             if string_op_leaves
             else 0
         )
             if string_op_leaves
             else 0
         )