aboutsummaryrefslogtreecommitdiff
path: root/lldb/third_party/Python/module
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/third_party/Python/module')
-rw-r--r--lldb/third_party/Python/module/progress/progress.py25
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/case.py21
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/main.py3
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/result.py7
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/suite.py3
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/test/test_case.py3
-rw-r--r--lldb/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py3
7 files changed, 27 insertions, 38 deletions
diff --git a/lldb/third_party/Python/module/progress/progress.py b/lldb/third_party/Python/module/progress/progress.py
index e4bd9d5fd5b4..833d1a3fc3f2 100644
--- a/lldb/third_party/Python/module/progress/progress.py
+++ b/lldb/third_party/Python/module/progress/progress.py
@@ -3,7 +3,6 @@
from __future__ import print_function
import use_lldb_suite
-import six
import sys
import time
@@ -21,17 +20,17 @@ class ProgressBar(object):
format Format
incremental
"""
- light_block = six.unichr(0x2591).encode("utf-8")
- solid_block = six.unichr(0x2588).encode("utf-8")
- solid_right_arrow = six.unichr(0x25BA).encode("utf-8")
+ light_block = chr(0x2591).encode("utf-8")
+ solid_block = chr(0x2588).encode("utf-8")
+ solid_right_arrow = chr(0x25BA).encode("utf-8")
def __init__(self,
start=0,
end=10,
width=12,
- fill=six.unichr(0x25C9).encode("utf-8"),
- blank=six.unichr(0x25CC).encode("utf-8"),
- marker=six.unichr(0x25CE).encode("utf-8"),
+ fill=chr(0x25C9).encode("utf-8"),
+ blank=chr(0x25CC).encode("utf-8"),
+ marker=chr(0x25CE).encode("utf-8"),
format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%',
incremental=True):
super(ProgressBar, self).__init__()
@@ -91,9 +90,9 @@ class AnimatedProgressBar(ProgressBar):
start=0,
end=10,
width=12,
- fill=six.unichr(0x25C9).encode("utf-8"),
- blank=six.unichr(0x25CC).encode("utf-8"),
- marker=six.unichr(0x25CE).encode("utf-8"),
+ fill=chr(0x25C9).encode("utf-8"),
+ blank=chr(0x25CC).encode("utf-8"),
+ marker=chr(0x25CE).encode("utf-8"),
format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%',
incremental=True,
stdout=sys.stdout):
@@ -129,9 +128,9 @@ class ProgressWithEvents(AnimatedProgressBar):
start=0,
end=10,
width=12,
- fill=six.unichr(0x25C9).encode("utf-8"),
- blank=six.unichr(0x25CC).encode("utf-8"),
- marker=six.unichr(0x25CE).encode("utf-8"),
+ fill=chr(0x25C9).encode("utf-8"),
+ blank=chr(0x25CC).encode("utf-8"),
+ marker=chr(0x25CE).encode("utf-8"),
format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%',
incremental=True,
stdout=sys.stdout):
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/case.py b/lldb/third_party/Python/module/unittest2/unittest2/case.py
index c567037ea8a4..a24b9af98f40 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/case.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/case.py
@@ -7,8 +7,6 @@ import re
import unittest
import warnings
-import six
-
from unittest2 import result
from unittest2.util import (
safe_repr, safe_str, strclass,
@@ -153,7 +151,7 @@ class _AssertRaisesContext(object):
return True
expected_regexp = self.expected_regexp
- if isinstance(expected_regexp, six.string_types):
+ if isinstance(expected_regexp, str):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(str(exc_value)):
raise self.failureException(
@@ -173,7 +171,7 @@ class _TypeEqualityDict(object):
def __getitem__(self, key):
value = self._store[key]
- if isinstance(value, six.string_types):
+ if isinstance(value, str):
return getattr(self.testcase, value)
return value
@@ -251,10 +249,7 @@ class TestCase(unittest.TestCase):
self.addTypeEqualityFunc(tuple, 'assertTupleEqual')
self.addTypeEqualityFunc(set, 'assertSetEqual')
self.addTypeEqualityFunc(frozenset, 'assertSetEqual')
- if six.PY2:
- self.addTypeEqualityFunc(unicode, 'assertMultiLineEqual')
- else:
- self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
+ self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
def addTypeEqualityFunc(self, typeobj, function):
"""Add a type specific assertEqual style function to compare a type.
@@ -993,9 +988,9 @@ class TestCase(unittest.TestCase):
def assertMultiLineEqual(self, first, second, msg=None):
"""Assert that two multi-line strings are equal."""
- self.assert_(isinstance(first, six.string_types), (
+ self.assert_(isinstance(first, str), (
'First argument is not a string'))
- self.assert_(isinstance(second, six.string_types), (
+ self.assert_(isinstance(second, str), (
'Second argument is not a string'))
if first != second:
@@ -1076,7 +1071,7 @@ class TestCase(unittest.TestCase):
try:
callable_obj(*args, **kwargs)
except expected_exception as exc_value:
- if isinstance(expected_regexp, six.string_types):
+ if isinstance(expected_regexp, str):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(str(exc_value)):
raise self.failureException(
@@ -1091,7 +1086,7 @@ class TestCase(unittest.TestCase):
def assertRegexpMatches(self, text, expected_regexp, msg=None):
"""Fail the test unless the text matches the regular expression."""
- if isinstance(expected_regexp, six.string_types):
+ if isinstance(expected_regexp, str):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(text):
msg = msg or "Regexp didn't match"
@@ -1101,7 +1096,7 @@ class TestCase(unittest.TestCase):
def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None):
"""Fail the test if the text matches the regular expression."""
- if isinstance(unexpected_regexp, six.string_types):
+ if isinstance(unexpected_regexp, str):
unexpected_regexp = re.compile(unexpected_regexp)
match = unexpected_regexp.search(text)
if match:
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/main.py b/lldb/third_party/Python/module/unittest2/unittest2/main.py
index 76e3e7323a85..0d3c5b8bd6c4 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/main.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/main.py
@@ -3,7 +3,6 @@
import sys
import os
import types
-import six
from unittest2 import loader, runner
try:
@@ -77,7 +76,7 @@ class TestProgram(object):
argv=None, testRunner=None,
testLoader=loader.defaultTestLoader, exit=True,
verbosity=1, failfast=None, catchbreak=None, buffer=None):
- if isinstance(module, six.string_types):
+ if isinstance(module, str):
self.module = __import__(module)
for part in module.split('.')[1:]:
self.module = getattr(self.module, part)
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/result.py b/lldb/third_party/Python/module/unittest2/unittest2/result.py
index 8f89816b772f..97eb4fa85148 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/result.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/result.py
@@ -2,12 +2,11 @@
import use_lldb_suite
+import io
import sys
import traceback
import unittest
-from six import StringIO as SixStringIO
-
from unittest2 import util
from unittest2.compatibility import wraps
@@ -65,8 +64,8 @@ class TestResult(unittest.TestResult):
self._mirrorOutput = False
if self.buffer:
if self._stderr_buffer is None:
- self._stderr_buffer = SixStringIO()
- self._stdout_buffer = SixStringIO()
+ self._stderr_buffer = io.StringIO()
+ self._stdout_buffer = io.StringIO()
sys.stdout = self._stdout_buffer
sys.stderr = self._stderr_buffer
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/suite.py b/lldb/third_party/Python/module/unittest2/unittest2/suite.py
index 6b50680ec098..f2554447cc91 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/suite.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/suite.py
@@ -3,7 +3,6 @@
import sys
import unittest
from unittest2 import case, util
-import six
__unittest = True
@@ -50,7 +49,7 @@ class BaseTestSuite(unittest.TestSuite):
self._tests.append(test)
def addTests(self, tests):
- if isinstance(tests, six.string_types):
+ if isinstance(tests, str):
raise TypeError("tests must be an iterable of tests, not a string")
for test in tests:
self.addTest(test)
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/test/test_case.py b/lldb/third_party/Python/module/unittest2/unittest2/test/test_case.py
index acf7e4edc57b..795fa39be735 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/test/test_case.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/test/test_case.py
@@ -1,7 +1,6 @@
import difflib
import pprint
import re
-import six
from copy import deepcopy
@@ -543,7 +542,7 @@ class Test_TestCase(unittest2.TestCase, EqualityMixin, HashingMixin):
def runTest(self):
pass
- self.assertIsInstance(Foo().id(), six.string_types)
+ self.assertIsInstance(Foo().id(), str)
# "If result is omitted or None, a temporary result object is created
# and used, but is not made available to the caller. As TestCase owns the
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py b/lldb/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py
index ccfadc97d364..9bafb54be5a6 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py
@@ -1,5 +1,4 @@
import unittest2
-import six
from unittest2.test.support import LoggingResult
@@ -125,7 +124,7 @@ class Test_FunctionTestCase(unittest2.TestCase):
def test_id(self):
test = unittest2.FunctionTestCase(lambda: None)
- self.assertIsInstance(test.id(), six.string_types)
+ self.assertIsInstance(test.id(), str)
# "Returns a one-line description of the test, or None if no description
# has been provided. The default implementation of this method returns