Skip to content

Commit c9ae767

Browse files
committed
Fix outdated references to 3.6 and run pyupgrade
I also missed the accidental removal of the 3.11 classifier in the PR.
1 parent 468ceaf commit c9ae767

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

docs/getting_started.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ Also, you can try out _Black_ online for minimal fuss on the
1616

1717
## Installation
1818

19-
_Black_ can be installed by running `pip install black`. It requires Python 3.6.2+ to
20-
run. If you want to format Jupyter Notebooks, install with
21-
`pip install 'black[jupyter]'`.
19+
_Black_ can be installed by running `pip install black`. It requires Python 3.7+ to run.
20+
If you want to format Jupyter Notebooks, install with `pip install 'black[jupyter]'`.
2221

2322
If you can't wait for the latest _hotness_ and want to install from GitHub, use:
2423

docs/integrations/editors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ curl https://raw.githubusercontent.com/psf/black/stable/autoload/black.vim -o ~/
148148
Let me know if this requires any changes to work with Vim 8's builtin `packadd`, or
149149
Pathogen, and so on.
150150

151-
This plugin **requires Vim 7.0+ built with Python 3.6+ support**. It needs Python 3.6 to
151+
This plugin **requires Vim 7.0+ built with Python 3.7+ support**. It needs Python 3.7 to
152152
be able to run _Black_ inside the Vim process which is much faster than calling an
153153
external command.
154154

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ classifiers = [
5858
"Programming Language :: Python :: 3.8",
5959
"Programming Language :: Python :: 3.9",
6060
"Programming Language :: Python :: 3.10",
61+
"Programming Language :: Python :: 3.11",
6162
"Topic :: Software Development :: Libraries :: Python Modules",
6263
"Topic :: Software Development :: Quality Assurance",
6364
]

src/black/comments.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ def _generate_ignored_nodes_from_fmt_skip(
270270
while "\n" not in prev_sibling.prefix and prev_sibling.prev_sibling is not None:
271271
prev_sibling = prev_sibling.prev_sibling
272272
siblings.insert(0, prev_sibling)
273-
for sibling in siblings:
274-
yield sibling
273+
yield from siblings
275274
elif (
276275
parent is not None and parent.type == syms.suite and leaf.type == token.NEWLINE
277276
):

src/black/concurrency.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def shutdown(loop: asyncio.AbstractEventLoop) -> None:
5858

5959
for task in to_cancel:
6060
task.cancel()
61-
if sys.version_info >= (3, 7):
62-
loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
63-
else:
64-
loop.run_until_complete(
65-
asyncio.gather(*to_cancel, loop=loop, return_exceptions=True)
66-
)
61+
loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
6762
finally:
6863
# `concurrent.futures.Future` objects cannot be cancelled once they
6964
# are already running. There might be some when the `shutdown()` happened.
@@ -191,9 +186,6 @@ async def schedule_formatting(
191186
sources_to_cache.append(src)
192187
report.done(src, changed)
193188
if cancelled:
194-
if sys.version_info >= (3, 7):
195-
await asyncio.gather(*cancelled, return_exceptions=True)
196-
else:
197-
await asyncio.gather(*cancelled, loop=loop, return_exceptions=True)
189+
await asyncio.gather(*cancelled, return_exceptions=True)
198190
if sources_to_cache:
199191
write_cache(cache, sources_to_cache, mode)

src/black/trans.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ def do_transform(self, line: Line, string_idx: int) -> Iterator[TResult[Line]]:
12561256

12571257
string_op_leaves = self._get_string_operator_leaves(LL)
12581258
string_op_leaves_length = (
1259-
sum([len(str(prefix_leaf)) for prefix_leaf in string_op_leaves]) + 1
1259+
sum(len(str(prefix_leaf)) for prefix_leaf in string_op_leaves) + 1
12601260
if string_op_leaves
12611261
else 0
12621262
)

0 commit comments

Comments
 (0)