Skip to content

Commit

Permalink
Use Python 3.8 compatible syntax (posit-dev/positron-python#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
petetronic authored and wesm committed May 23, 2023
1 parent 42e9522 commit 72724b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions extensions/positron-python/pythonFiles/positron/lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

import urllib.parse
from typing import Tuple
from typing import Optional, Tuple

from .positron_jedilsp import POSITRON

Expand Down Expand Up @@ -53,7 +53,7 @@ def shutdown(self) -> None:
except Exception:
pass

def split_address(self, client_address: str) -> Tuple[str | None, int | None]:
def split_address(self, client_address: str) -> Tuple[Optional[str], Optional[int]]:
"""
Split an address of the form "host:port" into a tuple of (host, port).
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,10 @@ def start(self, lsp_host: str, lsp_port: int, kernel) -> None:
global KERNEL
KERNEL = kernel

loop = asyncio.get_event_loop()
try:
asyncio.ensure_future(self._start_jedi(lsp_host, lsp_port))
loop.run_forever()
except KeyboardInterrupt:
pass
finally:
loop.close()

async def _start_jedi(self, lsp_host, lsp_port):
"""Starts Jedi LSP as a TCP server using existing asyncio loop."""
Expand Down

0 comments on commit 72724b0

Please sign in to comment.