xref: /llvm-project-15.0.7/lldb/packages/Python/lldbsuite/support/seven.py (revision d5658b08)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import six
2
3if six.PY2:
4    import commands
5    get_command_output = commands.getoutput
6    get_command_status_output = commands.getstatusoutput
7
8    cmp_ = cmp
9else:
10    def get_command_status_output(command):
11        try:
12            import subprocess
13            return (0, subprocess.check_output(command, shell=True, universal_newlines=True))
14        except subprocess.CalledProcessError as e:
15            return (e.returncode, e.output)
16
17    def get_command_output(command):
18        return get_command_status_output(command)[1]
19
20    cmp_ = lambda x, y: (x > y) - (x < y)

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026