Skip to content

Commit

Permalink
Remove distutils and replace with shutil to support Python 3.12 in sw…
Browse files Browse the repository at this point in the history
…-remote-api
  • Loading branch information
mccleeary-galois committed May 16, 2024
1 parent d85e8a5 commit 2ed03c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion saw-remote-api/python/saw_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import time
import atexit
from distutils.spawn import find_executable
from shutil import which

import cryptol

Expand Down
6 changes: 3 additions & 3 deletions saw-remote-api/python/saw_client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import signal
import sys
from distutils.spawn import find_executable
from shutil import which
from argo_client.connection import ServerConnection, DynamicSocketProcess, HttpProcess, ManagedProcess
from argo_client.interaction import Interaction, Command
from .commands import *
Expand Down Expand Up @@ -52,11 +52,11 @@ def connect(command: Union[str, ServerConnection, None] = None,
c = SAWConnection(command, log_dest=log_dest)
elif url is not None:
c = SAWConnection(ServerConnection(HttpProcess(url, verify=verify)), log_dest=log_dest)
elif (command := os.getenv('SAW_SERVER')) is not None and (command := find_executable(command)) is not None:
elif (command := os.getenv('SAW_SERVER')) is not None and (command := which(command)) is not None:
c = SAWConnection(command+" socket", log_dest=log_dest) # SAWConnection(ServerConnection(StdIOProcess(command+" stdio")))
elif (url := os.getenv('SAW_SERVER_URL')) is not None:
c = SAWConnection(ServerConnection(HttpProcess(url, verify=verify)), log_dest=log_dest)
elif (command := find_executable('saw-remote-api')) is not None:
elif (command := which('saw-remote-api')) is not None:
c = SAWConnection(command+" socket", log_dest=log_dest)
else:
raise ValueError(
Expand Down

0 comments on commit 2ed03c8

Please sign in to comment.