Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: mattip <matti.picus@gmail.com>
  • Loading branch information
mattip committed Nov 28, 2024
1 parent ed1e660 commit 5ec514e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
17 changes: 12 additions & 5 deletions python/ray/tests/test_ray_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ def f():

# Make sure that calling "continue" in the debugger
# gives back control to the debugger loop:
if sys.platform == 'win32':
if sys.platform == "win32":
from pexpect.popen_spawn import PopenSpawn

p = PopenSpawn("ray debug", encoding="utf-8")
else:
p = pexpect.spawn("ray debug")
Expand Down Expand Up @@ -122,8 +123,9 @@ def f():
> 0
)

if sys.platform == 'win32':
if sys.platform == "win32":
from pexpect.popen_spawn import PopenSpawn

p = PopenSpawn("ray debug", encoding="utf-8")
else:
p = pexpect.spawn("ray debug")
Expand Down Expand Up @@ -164,8 +166,9 @@ def fact(n):
)

p = pexpect.spawn("ray debug")
if sys.platform == 'win32':
if sys.platform == "win32":
from pexpect.popen_spawn import PopenSpawn

p = PopenSpawn("ray debug", encoding="utf-8")
else:
p = pexpect.spawn("ray debug")
Expand Down Expand Up @@ -226,8 +229,9 @@ def one_active_session():

# Start the debugger. This should clean up any existing sessions that
# belong to dead jobs.
if sys.platform == 'win32':
if sys.platform == "win32":
from pexpect.popen_spawn import PopenSpawn

p = PopenSpawn("ray debug", encoding="utf-8") # noqa: F841
else:
p = pexpect.spawn("ray debug") # noqa:F841
Expand All @@ -241,7 +245,10 @@ def no_active_sessions():

wait_for_condition(no_active_sessions)

@pytest.mark.skipif(platform.system() == "Windows", reason="Windows does not print '--address' on init")

@pytest.mark.skipif(
platform.system() == "Windows", reason="Windows does not print '--address' on init"
)
@pytest.mark.parametrize("ray_debugger_external", [False, True])
def test_ray_debugger_public(shutdown_only, call_ray_stop_only, ray_debugger_external):
redis_substring_prefix = "--address='"
Expand Down
9 changes: 5 additions & 4 deletions python/ray/util/rpdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def __init__(self, connection):
self.flush = fh.flush
self.fileno = fh.fileno
if hasattr(fh, "encoding"):
self._send = lambda data: connection.sendall(data.encode(fh.encoding, errors="replace"))
self._send = lambda data: connection.sendall(
data.encode(fh.encoding, errors="replace")
)
else:
self._send = connection.sendall

Expand Down Expand Up @@ -341,16 +343,15 @@ def _post_mortem():
rdb.post_mortem()



def _connect_pdb_client(host, port):
if sys.platform == 'win32':
if sys.platform == "win32":
import msvcrt
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))

while True:
# Get the list of sockets which are readable.
if sys.platform == 'win32':
if sys.platform == "win32":
ready_to_read = select.select([s], [], [], 1)[0]
if msvcrt.kbhit():
ready_to_read.append(sys.stdin)
Expand Down

0 comments on commit 5ec514e

Please sign in to comment.