Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

<!-- Changes to Black's terminal output and error messages -->

- Change from deprecated `asyncio.get_event_loop()` to create our event loop which
removes DesprecationWarning (#3164)

### Packaging

<!-- Changes to how Black is packaged, such as dependency requirements -->
Expand Down
2 changes: 1 addition & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ def reformat_many(
from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor

executor: Executor
loop = asyncio.get_event_loop()
worker_count = workers if workers is not None else DEFAULT_WORKERS
if sys.platform == "win32":
# Work around https://bugs.python.org/issue26903
Expand All @@ -788,6 +787,7 @@ def reformat_many(
# any good due to the Global Interpreter Lock)
executor = ThreadPoolExecutor(max_workers=1)

loop = asyncio.new_event_loop()
try:
loop.run_until_complete(
schedule_formatting(
Expand Down