File: run-with-pty.py

package info (click to toggle)
ansible-core 2.19.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,944 kB
  • sloc: python: 181,408; cs: 4,929; sh: 4,661; xml: 34; makefile: 21
file content (12 lines) | stat: -rwxr-xr-x 234 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3
"""Run a command using a PTY."""
from __future__ import annotations

import sys

if sys.version_info < (3, 10):
    import vendored_pty as pty
else:
    import pty

sys.exit(1 if pty.spawn(sys.argv[1:]) else 0)