[dotest] Remove dead code
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 26 Jul 2019 01:58:18 +0000 (01:58 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 26 Jul 2019 01:58:18 +0000 (01:58 +0000)
Remove some dead code that I ran into when preparing D65311.

llvm-svn: 367079

lldb/packages/Python/lldbsuite/test/decorators.py
lldb/packages/Python/lldbsuite/test/dotest.py
lldb/packages/Python/lldbsuite/test/lldbplatform.py
lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
lldb/packages/Python/lldbsuite/test/lldbtest.py

index 5c69c18..d5b2ec3 100644 (file)
@@ -2,9 +2,8 @@ from __future__ import absolute_import
 from __future__ import print_function
 
 # System modules
-from distutils.version import LooseVersion, StrictVersion
+from distutils.version import LooseVersion
 from functools import wraps
-import inspect
 import os
 import platform
 import re
@@ -17,8 +16,6 @@ import six
 import unittest2
 
 # LLDB modules
-import use_lldb_suite
-
 import lldb
 from . import configuration
 from . import test_categories
index a6d38fa..6640b09 100644 (file)
@@ -29,7 +29,6 @@ import logging
 import platform
 import re
 import signal
-import socket
 import subprocess
 import sys
 
@@ -58,7 +57,7 @@ def is_exe(fpath):
 
 def which(program):
     """Returns the full path to a program; None otherwise."""
-    fpath, fname = os.path.split(program)
+    fpath, _ = os.path.split(program)
     if fpath:
         if is_exe(program):
             return program
@@ -70,27 +69,6 @@ def which(program):
     return None
 
 
-class _WritelnDecorator(object):
-    """Used to decorate file-like objects with a handy 'writeln' method"""
-
-    def __init__(self, stream):
-        self.stream = stream
-
-    def __getattr__(self, attr):
-        if attr in ('stream', '__getstate__'):
-            raise AttributeError(attr)
-        return getattr(self.stream, attr)
-
-    def writeln(self, arg=None):
-        if arg:
-            self.write(arg)
-        self.write('\n')  # text-mode streams translate to \r\n if needed
-
-#
-# Global variables:
-#
-
-
 def usage(parser):
     parser.print_help()
     if configuration.verbose > 0:
@@ -558,17 +536,6 @@ def getXcodeOutputPaths(lldbRootDirectory):
     return result
 
 
-def createSocketToLocalPort(port):
-    def socket_closer(s):
-        """Close down an opened socket properly."""
-        s.shutdown(socket.SHUT_RDWR)
-        s.close()
-
-    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    sock.connect(("localhost", port))
-    return (sock, lambda: socket_closer(sock))
-
-
 def setupTestResults():
     """Sets up test results-related objects based on arg settings."""
     # Setup the results formatter configuration.
@@ -639,7 +606,7 @@ def getOutputPaths(lldbRootDirectory):
 def get_llvm_bin_dirs():
     """
     Returns an array of paths that may have the llvm/clang/etc binaries
-    in them, relative to this current file.  
+    in them, relative to this current file.
     Returns an empty array if none are found.
     """
     result = []
@@ -1090,14 +1057,6 @@ def getVersionForSDK(sdk):
     return ver
 
 
-def getPathForSDK(sdk):
-    sdk = str.lower(sdk)
-    full_path = seven.get_command_output('xcrun -sdk %s --show-sdk-path' % sdk)
-    if os.path.exists(full_path):
-        return full_path
-    return None
-
-
 def setDefaultTripleForPlatform():
     if configuration.lldb_platform_name == 'ios-simulator':
         triple_str = 'x86_64-apple-ios%s' % (
index 23d93e1..365c752 100644 (file)
@@ -9,7 +9,6 @@ import itertools
 import six
 
 # LLDB modules
-import use_lldb_suite
 import lldb
 
 windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, darwin_embedded, freebsd, netbsd, bsd_all, android = range(
index 940b01e..6e382d2 100644 (file)
@@ -16,7 +16,6 @@ from six.moves.urllib import parse as urlparse
 
 # LLDB modules
 from . import configuration
-import use_lldb_suite
 import lldb
 
 
index daa56e7..0d78dc1 100644 (file)
@@ -51,7 +51,6 @@ from subprocess import *
 import sys
 import time
 import traceback
-import types
 import distutils.spawn
 
 # Third-party modules
@@ -61,7 +60,6 @@ from six import StringIO as SixStringIO
 import six
 
 # LLDB modules
-import use_lldb_suite
 import lldb
 from . import configuration
 from . import decorators