Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Dec 28, 2024
1 parent 3e9a1fb commit 8ba4777
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/reactpy_django/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@ class SyncLayout(Layout):
def __enter__(self):
self.loop = asyncio.new_event_loop()
self.thread = ThreadPoolExecutor(max_workers=1)
return self.thread.submit(self.loop.run_until_complete, self.__aenter__()).result()
self.thread.submit(self.loop.run_until_complete, self.__aenter__()).result()
return self

def __exit__(self, *exec):
result = self.thread.submit(self.loop.run_until_complete, self.__aexit__(*exec)).result()
def __exit__(self, exc_type, exc_val, exc_tb):
self.thread.submit(self.loop.run_until_complete, self.__aexit__()).result()
self.loop.close()
self.thread.shutdown()
return result

def sync_render(self):
return self.thread.submit(self.loop.run_until_complete, self.render()).result()
Expand Down

0 comments on commit 8ba4777

Please sign in to comment.