summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-20 21:06:05 +0000
committerZachary Turner <zturner@google.com>2015-10-20 21:06:05 +0000
commit43a01e45f93443d1bc7d23167f84d06f135b64b2 (patch)
treed530d8db08e49bef81798aa164045f5b9ccdf12d
parent8741e318767ba5567cdcd402f336f182819fdbc1 (diff)
downloadbcm5719-llvm-43a01e45f93443d1bc7d23167f84d06f135b64b2.tar.gz
bcm5719-llvm-43a01e45f93443d1bc7d23167f84d06f135b64b2.zip
Use six to portably assign metaclasses in Python 2 and 3.
llvm-svn: 250859
-rwxr-xr-xlldb/test/dotest.py1
-rw-r--r--lldb/test/lldbtest.py12
2 files changed, 7 insertions, 6 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py
index d1fae3b0abc..17b359ab556 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -44,7 +44,6 @@ import lldbtest_config
import six
-
def is_exe(fpath):
"""Returns true if fpath is an executable."""
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 69ca549e875..f31012034d6 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -33,6 +33,8 @@ $
from __future__ import print_function
+import lldb_shared
+
import abc
import gc
import glob
@@ -48,7 +50,8 @@ import unittest2
import lldb
import lldbtest_config
import lldbutil
-from _pyio import __metaclass__
+
+from six import add_metaclass
if sys.version_info.major < 3:
import urlparse
@@ -254,8 +257,8 @@ class recording(StringIO.StringIO):
print(self.getvalue(), file=self.session)
self.close()
+@add_metaclass(abc.ABCMeta)
class _BaseProcess(object):
- __metaclass__ = abc.ABCMeta
@abc.abstractproperty
def pid(self):
@@ -2279,6 +2282,8 @@ class LLDBTestCaseFactory(type):
newattrs[attrname] = attrvalue
return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, newattrs)
+# Setup the metaclass for this class to change the list of the test methods when a new class is loaded
+@add_metaclass(LLDBTestCaseFactory)
class TestBase(Base):
"""
This abstract base class is meant to be subclassed. It provides default
@@ -2339,9 +2344,6 @@ class TestBase(Base):
# Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
timeWaitNextLaunch = 1.0;
- # Setup the metaclass for this class to change the list of the test methods when a new class is loaded
- __metaclass__ = LLDBTestCaseFactory
-
def doDelay(self):
"""See option -w of dotest.py."""
if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and
OpenPOWER on IntegriCloud