Skip to content

Commit

Permalink
installation/executor.py: remove redundant Executor.submit() call
Browse files Browse the repository at this point in the history
When the ThreadPoolExecutor is idle, this code:
```python
from concurrent.futures import wait, ThreadpoolExecutor
executor: ThreadpoolExecutor
wait([executor.submit(fn, arg)])
```
is equivalent to
```python
fn(arg)
```

Remove one such redundant call in installation/executor.py
  • Loading branch information
TheSven73 committed Sep 8, 2024
1 parent 3183126 commit 5247e35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def execute(self, operations: list[Operation]) -> int:
wait(tasks)

for operation in serial_operations:
wait([self._executor.submit(self._execute_operation, operation)])
self._execute_operation(operation)

except KeyboardInterrupt:
self._shutdown = True
Expand Down

0 comments on commit 5247e35

Please sign in to comment.