mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 09:21:45 +00:00
resolved termios error during execution on a windows environment
This commit is contained in:
parent
e86271aeac
commit
d3804f27c7
1 changed files with 10 additions and 2 deletions
|
@ -7,16 +7,24 @@
|
|||
import errno
|
||||
import logging
|
||||
import os
|
||||
import pty
|
||||
import select
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import termios
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# Handle Windows-specific code or import alternative modules if needed
|
||||
# For example, you could use the msvcrt module for some functionalities
|
||||
# that are similar to termios.
|
||||
if sys.platform.startswith('win'):
|
||||
import msvcrt
|
||||
else:
|
||||
# Unix-specific code here
|
||||
import pty
|
||||
import termios
|
||||
|
||||
# Rest of your code that uses termios or msvcrt on Windows
|
||||
# run a command in a pseudo-terminal, with interrupt handling,
|
||||
# useful when you want to run interactive things
|
||||
def run_with_pty(command):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue