Skip to content

Commit

Permalink
Fix call for displayhook
Browse files Browse the repository at this point in the history
  • Loading branch information
Klee Dienes committed Apr 19, 2024
1 parent 333a759 commit c8c41d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions carthage/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import code
import collections.abc
import concurrent.futures
import functools
import shlex
import re
import time
Expand Down Expand Up @@ -158,7 +159,7 @@ def raw_input(self, *args, **kwargs):

def displayhook(self, obj):

def future_callback(f):
def future_callback(num, f):
del self.history[num]
try:
self.history[num] = f.result()
Expand All @@ -171,7 +172,7 @@ def future_callback(f):
self.history_num += 1
num = self.history_num
future = asyncio.run_coroutine_threadsafe(obj, loop=self.loop)
future.add_done_callback(future_callback)
future.add_done_callback(functools.partial(future_callback, num))
print(f'[{num}]: async {obj.__name__}')
self.history[num] = future
self.loop.call_soon_threadsafe(CarthageConsole.noop)
Expand Down

0 comments on commit c8c41d6

Please sign in to comment.