Skip to content

Commit 7ec37f4

Browse files
committed
Lint the code
1 parent 153a48b commit 7ec37f4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/appose/python_worker.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ def execute_script():
147147
# as a whole on its own Thread. Why? Because on Windows, some imports
148148
# (e.g. numpy) may lead to hangs if loaded from a separate thread.
149149
# See https://github.com/apposed/appose/issues/13.
150-
block = ast.parse(script, mode='exec')
150+
block = ast.parse(script, mode="exec")
151151
import_nodes = [
152-
node for node in block.body
152+
node
153+
for node in block.body
153154
if isinstance(node, (ast.Import, ast.ImportFrom))
154155
]
155156
import_block = ast.Module(body=import_nodes, type_ignores=[])
@@ -207,7 +208,9 @@ def cleanup_threads():
207208
while running:
208209
sleep(0.05)
209210
dead = {
210-
uuid: task for uuid, task in tasks.items() if task.thread is not None and not task.thread.is_alive()
211+
uuid: task
212+
for uuid, task in tasks.items()
213+
if task.thread is not None and not task.thread.is_alive()
211214
}
212215
for uuid, task in dead.items():
213216
tasks.pop(uuid)

src/appose/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ def is_terminal(self):
270270

271271

272272
class TaskEvent:
273-
def __init__(self, task: "Task", response_type: ResponseType, info: Optional[Dict[str, Any]]) -> None:
273+
def __init__(
274+
self, task: "Task", response_type: ResponseType, info: Optional[Dict[str, Any]]
275+
) -> None:
274276
self.task: "Task" = task
275277
self.response_type: ResponseType = response_type
276278
self.info: Optional[Dict[str, Any]] = info

0 commit comments

Comments
 (0)