summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/six
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/catapult/third_party/six')
-rw-r--r--chromium/third_party/catapult/third_party/six/CHANGES74
-rw-r--r--chromium/third_party/catapult/third_party/six/LICENSE2
-rw-r--r--chromium/third_party/catapult/third_party/six/PKG-INFO47
-rw-r--r--chromium/third_party/catapult/third_party/six/README17
-rw-r--r--chromium/third_party/catapult/third_party/six/README.chromium6
-rw-r--r--chromium/third_party/catapult/third_party/six/README.rst29
-rw-r--r--chromium/third_party/catapult/third_party/six/documentation/conf.py2
-rw-r--r--chromium/third_party/catapult/third_party/six/documentation/index.rst347
-rw-r--r--chromium/third_party/catapult/third_party/six/setup.cfg26
-rw-r--r--chromium/third_party/catapult/third_party/six/setup.py14
-rw-r--r--chromium/third_party/catapult/third_party/six/six.egg-info/PKG-INFO47
-rw-r--r--chromium/third_party/catapult/third_party/six/six.egg-info/SOURCES.txt15
-rw-r--r--chromium/third_party/catapult/third_party/six/six.egg-info/dependency_links.txt1
-rw-r--r--chromium/third_party/catapult/third_party/six/six.egg-info/top_level.txt1
-rw-r--r--chromium/third_party/catapult/third_party/six/six.py186
-rw-r--r--chromium/third_party/catapult/third_party/six/test_six.py323
16 files changed, 833 insertions, 304 deletions
diff --git a/chromium/third_party/catapult/third_party/six/CHANGES b/chromium/third_party/catapult/third_party/six/CHANGES
index 6e9df6dec55..f3bf6a4a7f9 100644
--- a/chromium/third_party/catapult/third_party/six/CHANGES
+++ b/chromium/third_party/catapult/third_party/six/CHANGES
@@ -3,6 +3,76 @@ Changelog for six
This file lists the changes in each six version.
+1.16.0
+------
+
+- Pull request #343, issue #341, pull request #349: Port _SixMetaPathImporter to
+ Python 3.10.
+
+1.15.0
+------
+
+- Pull request #331: Optimize `six.ensure_str` and `six.ensure_binary`.
+
+1.14.0
+------
+
+- Issue #288, pull request #289: Add `six.assertNotRegex`.
+
+- Issue #317: `six.moves._dummy_thread` now points to the `_thread` module on
+ Python 3.9+. Python 3.7 and later requires threading and deprecated the
+ `_dummy_thread` module.
+
+- Issue #308, pull request #314: Remove support for Python 2.6 and Python 3.2.
+
+- Issue #250, issue #165, pull request #251: `six.wraps` now ignores missing
+ attributes. This follows the Python 3.2+ standard library behavior.
+
+1.13.0
+------
+
+- Issue #298, pull request #299: Add `six.moves.dbm_ndbm`.
+
+- Issue #155: Add `six.moves.collections_abc`, which aliases the `collections`
+ module on Python 2-3.2 and the `collections.abc` on Python 3.3 and greater.
+
+- Pull request #304: Re-add distutils fallback in `setup.py`.
+
+- Pull request #305: On Python 3.7, `with_metaclass` supports classes using PEP
+ 560 features.
+
+1.12.0
+------
+
+- Issue #259, pull request #260: `six.add_metaclass` now preserves
+ `__qualname__` from the original class.
+
+- Pull request #204: Add `six.ensure_binary`, `six.ensure_text`, and
+ `six.ensure_str`.
+
+1.11.0
+------
+
+- Pull request #178: `with_metaclass` now properly proxies `__prepare__` to the
+ underlying metaclass.
+
+- Pull request #191: Allow `with_metaclass` to work with metaclasses implemented
+ in C.
+
+- Pull request #203: Add parse_http_list and parse_keqv_list to moved
+ urllib.request.
+
+- Pull request #172 and issue #171: Add unquote_to_bytes to moved urllib.parse.
+
+- Pull request #167: Add `six.moves.getoutput`.
+
+- Pull request #80: Add `six.moves.urllib_parse.splitvalue`.
+
+- Pull request #75: Add `six.moves.email_mime_image`.
+
+- Pull request #72: Avoid creating reference cycles through tracebacks in
+ `reraise`.
+
1.10.0
------
@@ -36,7 +106,7 @@ This file lists the changes in each six version.
- Issue #98: Fix `six.moves` race condition in multi-threaded code.
-- Pull request #51: Add `six.view(keys|values|itmes)`, which provide dictionary
+- Pull request #51: Add `six.view(keys|values|items)`, which provide dictionary
views on Python 2.7+.
- Issue #112: `six.moves.reload_module` now uses the importlib module on
@@ -163,7 +233,7 @@ This file lists the changes in each six version.
- Issue #40: Add import mapping for the Python 2 gdbm module.
- Issue #35: On Python versions less than 2.7, print_ now encodes unicode
- strings when outputing to standard streams. (Python 2.7 handles this
+ strings when outputting to standard streams. (Python 2.7 handles this
automatically.)
1.4.1
diff --git a/chromium/third_party/catapult/third_party/six/LICENSE b/chromium/third_party/catapult/third_party/six/LICENSE
index e558f9d494a..de6633112c1 100644
--- a/chromium/third_party/catapult/third_party/six/LICENSE
+++ b/chromium/third_party/catapult/third_party/six/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2015 Benjamin Peterson
+Copyright (c) 2010-2020 Benjamin Peterson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/chromium/third_party/catapult/third_party/six/PKG-INFO b/chromium/third_party/catapult/third_party/six/PKG-INFO
new file mode 100644
index 00000000000..1e57620bb60
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/PKG-INFO
@@ -0,0 +1,47 @@
+Metadata-Version: 1.2
+Name: six
+Version: 1.16.0
+Summary: Python 2 and 3 compatibility utilities
+Home-page: https://github.com/benjaminp/six
+Author: Benjamin Peterson
+Author-email: benjamin@python.org
+License: MIT
+Description: .. image:: https://img.shields.io/pypi/v/six.svg
+ :target: https://pypi.org/project/six/
+ :alt: six on PyPI
+
+ .. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
+ :target: https://travis-ci.org/benjaminp/six
+ :alt: six on TravisCI
+
+ .. image:: https://readthedocs.org/projects/six/badge/?version=latest
+ :target: https://six.readthedocs.io/
+ :alt: six's documentation on Read the Docs
+
+ .. image:: https://img.shields.io/badge/license-MIT-green.svg
+ :target: https://github.com/benjaminp/six/blob/master/LICENSE
+ :alt: MIT License badge
+
+ Six is a Python 2 and 3 compatibility library. It provides utility functions
+ for smoothing over the differences between the Python versions with the goal of
+ writing Python code that is compatible on both Python versions. See the
+ documentation for more information on what is provided.
+
+ Six supports Python 2.7 and 3.3+. It is contained in only one Python
+ file, so it can be easily copied into your project. (The copyright and license
+ notice must be retained.)
+
+ Online documentation is at https://six.readthedocs.io/.
+
+ Bugs can be reported to https://github.com/benjaminp/six. The code can also
+ be found there.
+
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Topic :: Utilities
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*
diff --git a/chromium/third_party/catapult/third_party/six/README b/chromium/third_party/catapult/third_party/six/README
index ee628a9db6b..560a773d9e1 100644
--- a/chromium/third_party/catapult/third_party/six/README
+++ b/chromium/third_party/catapult/third_party/six/README
@@ -1,16 +1,7 @@
-Six is a Python 2 and 3 compatibility library. It provides utility functions
-for smoothing over the differences between the Python versions with the goal of
-writing Python code that is compatible on both Python versions. See the
-documentation for more information on what is provided.
+Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.
-Six supports every Python version since 2.6. It is contained in only one Python
-file, so it can be easily copied into your project. (The copyright and license
-notice must be retained.)
+Six supports Python 2.7 and 3.3+. It is contained in only one Python file, so it can be easily copied into your project. (The copyright and license notice must be retained.)
-Online documentation is at https://pythonhosted.org/six/.
+Online documentation is at https://six.readthedocs.io/.
-Bugs can be reported to https://bitbucket.org/gutworth/six. The code can also
-be found there.
-
-For questions about six or porting in general, email the python-porting mailing
-list: https://mail.python.org/mailman/listinfo/python-porting
+Bugs can be reported to https://github.com/benjaminp/six. The code can also be found there. \ No newline at end of file
diff --git a/chromium/third_party/catapult/third_party/six/README.chromium b/chromium/third_party/catapult/third_party/six/README.chromium
index 4606beb343f..64c83be5e31 100644
--- a/chromium/third_party/catapult/third_party/six/README.chromium
+++ b/chromium/third_party/catapult/third_party/six/README.chromium
@@ -1,7 +1,7 @@
Name: six
-URL: https://bitbucket.org/gutworth/six/
-Version: 1991f8b5b654f077e773f05695a08e0506b7367f
-Date: 2016-01-13
+URL: https://pypi.org/project/six/
+Version: 1.16.0
+Date: 2021-05-05
License: MIT
License File: LICENSE
Security Critical: no
diff --git a/chromium/third_party/catapult/third_party/six/README.rst b/chromium/third_party/catapult/third_party/six/README.rst
new file mode 100644
index 00000000000..6339ba5d932
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/README.rst
@@ -0,0 +1,29 @@
+.. image:: https://img.shields.io/pypi/v/six.svg
+ :target: https://pypi.org/project/six/
+ :alt: six on PyPI
+
+.. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
+ :target: https://travis-ci.org/benjaminp/six
+ :alt: six on TravisCI
+
+.. image:: https://readthedocs.org/projects/six/badge/?version=latest
+ :target: https://six.readthedocs.io/
+ :alt: six's documentation on Read the Docs
+
+.. image:: https://img.shields.io/badge/license-MIT-green.svg
+ :target: https://github.com/benjaminp/six/blob/master/LICENSE
+ :alt: MIT License badge
+
+Six is a Python 2 and 3 compatibility library. It provides utility functions
+for smoothing over the differences between the Python versions with the goal of
+writing Python code that is compatible on both Python versions. See the
+documentation for more information on what is provided.
+
+Six supports Python 2.7 and 3.3+. It is contained in only one Python
+file, so it can be easily copied into your project. (The copyright and license
+notice must be retained.)
+
+Online documentation is at https://six.readthedocs.io/.
+
+Bugs can be reported to https://github.com/benjaminp/six. The code can also
+be found there.
diff --git a/chromium/third_party/catapult/third_party/six/documentation/conf.py b/chromium/third_party/catapult/third_party/six/documentation/conf.py
index 0215bdd4059..2f0f3238ae8 100644
--- a/chromium/third_party/catapult/third_party/six/documentation/conf.py
+++ b/chromium/third_party/catapult/third_party/six/documentation/conf.py
@@ -33,7 +33,7 @@ master_doc = "index"
# General information about the project.
project = u"six"
-copyright = u"2010-2015, Benjamin Peterson"
+copyright = u"2010-2020, Benjamin Peterson"
sys.path.append(os.path.abspath(os.path.join(".", "..")))
from six import __version__ as six_version
diff --git a/chromium/third_party/catapult/third_party/six/documentation/index.rst b/chromium/third_party/catapult/third_party/six/documentation/index.rst
index 1391bacde94..45390b81b13 100644
--- a/chromium/third_party/catapult/third_party/six/documentation/index.rst
+++ b/chromium/third_party/catapult/third_party/six/documentation/index.rst
@@ -13,8 +13,8 @@ Python 3. It is intended to support codebases that work on both Python 2 and 3
without modification. six consists of only one Python file, so it is painless
to copy into a project.
-Six can be downloaded on `PyPi <http://pypi.python.org/pypi/six/>`_. Its bug
-tracker and code hosting is on `BitBucket <http://bitbucket.org/gutworth/six>`_.
+Six can be downloaded on `PyPI <https://pypi.org/project/six/>`_. Its bug
+tracker and code hosting is on `GitHub <https://github.com/benjaminp/six>`_.
The name, "six", comes from the fact that 2*3 equals 6. Why not addition?
Multiplication is more powerful, and, anyway, "five" has already been snatched
@@ -50,8 +50,9 @@ Six provides constants that may differ between Python versions. Ones ending
.. data:: class_types
- Possible class types. In Python 2, this encompasses old-style and new-style
- classes. In Python 3, this is just new-styles.
+ Possible class types. In Python 2, this encompasses old-style
+ :data:`py2:types.ClassType` and new-style ``type`` classes. In Python 3,
+ this is just ``type``.
.. data:: integer_types
@@ -75,7 +76,9 @@ Six provides constants that may differ between Python versions. Ones ending
.. data:: binary_type
Type for representing binary data. This is :func:`py2:str` in Python 2 and
- :func:`py3:bytes` in Python 3.
+ :func:`py3:bytes` in Python 3. Python 2.6 and 2.7 include ``bytes`` as a
+ builtin alias of ``str``, so six’s version is only necessary for Python 2.5
+ compatibility.
.. data:: MAXSIZE
@@ -104,7 +107,7 @@ Here's example usage of the module::
Object model compatibility
>>>>>>>>>>>>>>>>>>>>>>>>>>
-Python 3 renamed the attributes of several intepreter data structures. The
+Python 3 renamed the attributes of several interpreter data structures. The
following accessors are available. Note that the recommended way to inspect
functions and methods is the stdlib :mod:`py3:inspect` module.
@@ -164,7 +167,9 @@ functions and methods is the stdlib :mod:`py3:inspect` module.
Get the next item of iterator *it*. :exc:`py3:StopIteration` is raised if
the iterator is exhausted. This is a replacement for calling ``it.next()``
- in Python 2 and ``next(it)`` in Python 3.
+ in Python 2 and ``next(it)`` in Python 3. Python 2.6 and above have a
+ builtin ``next`` function, so six's version is only necessary for Python 2.5
+ compatibility.
.. function:: callable(obj)
@@ -252,9 +257,10 @@ functions and methods is the stdlib :mod:`py3:inspect` module.
.. decorator:: wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES)
- This is exactly the :func:`py3:functools.wraps` decorator, but it sets the
- ``__wrapped__`` attribute on what it decorates as :func:`py3:functools.wraps`
- does on Python versions after 3.2.
+ This is Python 3.2's :func:`py3:functools.wraps` decorator. It sets the
+ ``__wrapped__`` attribute on what it decorates. It doesn't raise an error if
+ any of the attributes mentioned in ``assigned`` and ``updated`` are missing
+ on ``wrapped`` object.
Syntax compatibility
@@ -345,7 +351,7 @@ Python 2 and 3.
on Python 3 or ::
class MyClass(object):
- __metaclass__ = MyMeta
+ __metaclass__ = Meta
on Python 2.
@@ -361,7 +367,7 @@ Binary and text data
>>>>>>>>>>>>>>>>>>>>
Python 3 enforces the distinction between byte strings and text strings far more
-rigoriously than Python 2 does; binary data cannot be automatically coerced to
+rigorously than Python 2 does; binary data cannot be automatically coerced to
or from text data. six provides several functions to assist in classifying
string data in all Python versions.
@@ -369,14 +375,14 @@ string data in all Python versions.
.. function:: b(data)
A "fake" bytes literal. *data* should always be a normal string literal. In
- Python 2, :func:`b` returns a 8-bit string. In Python 3, *data* is encoded
+ Python 2, :func:`b` returns an 8-bit string. In Python 3, *data* is encoded
with the latin-1 encoding to bytes.
.. note::
Since all Python versions 2.6 and after support the ``b`` prefix,
- :func:`b`, code without 2.5 support doesn't need :func:`b`.
+ code without 2.5 support doesn't need :func:`b`.
.. function:: u(text)
@@ -431,9 +437,27 @@ string data in all Python versions.
a bytes object iterator in Python 3.
+.. function:: ensure_binary(s, encoding='utf-8', errors='strict')
+
+ Coerce *s* to :data:`binary_type`. *encoding*, *errors* are the same as
+ :meth:`py3:str.encode`
+
+
+.. function:: ensure_str(s, encoding='utf-8', errors='strict')
+
+ Coerce *s* to ``str``. *encoding*, *errors* are the same as
+ :meth:`py3:str.encode`
+
+
+.. function:: ensure_text(s, encoding='utf-8', errors='strict')
+
+ Coerce *s* to :data:`text_type`. *encoding*, *errors* are the same as
+ :meth:`py3:bytes.decode`
+
+
.. data:: StringIO
- This is an fake file object for textual data. It's an alias for
+ This is a fake file object for textual data. It's an alias for
:class:`py2:StringIO.StringIO` in Python 2 and :class:`py3:io.StringIO` in
Python 3.
@@ -486,6 +510,11 @@ Note these functions are only available on Python 2.7 or later.
Alias for :meth:`~py3:unittest.TestCase.assertRegex` on Python 3 and
:meth:`~py2:unittest.TestCase.assertRegexpMatches` on Python 2.
+.. function:: assertNotRegex()
+
+ Alias for :meth:`~py3:unittest.TestCase.assertNotRegex` on Python 3 and
+ :meth:`~py2:unittest.TestCase.assertNotRegexpMatches` on Python 2.
+
Renamed modules and attributes compatibility
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -501,7 +530,7 @@ Python 2 or 3, write::
from six.moves import html_parser
Similarly, to get the function to reload modules, which was moved from the
-builtin module to the ``imp`` module, use::
+builtin module to the ``importlib`` module, use::
from six.moves import reload_module
@@ -509,7 +538,7 @@ For the most part, :mod:`six.moves` aliases are the names of the modules in
Python 3. When the new Python 3 name is a package, the components of the name
are separated by underscores. For example, ``html.parser`` becomes
``html_parser``. In some cases where several modules have been combined, the
-Python 2 name is retained. This is so the appropiate modules can be found when
+Python 2 name is retained. This is so the appropriate modules can be found when
running on Python 2. For example, ``BaseHTTPServer`` which is in
``http.server`` in Python 3 is aliased as ``BaseHTTPServer``.
@@ -530,14 +559,14 @@ functionality; its structure mimics the structure of the Python 3
from six.moves.cPickle import loads
- work, six places special proxy objects in in :data:`py3:sys.modules`. These
+ work, six places special proxy objects in :data:`py3:sys.modules`. These
proxies lazily load the underlying module when an attribute is fetched. This
will fail if the underlying module is not available in the Python
interpreter. For example, ``sys.modules["six.moves.winreg"].LoadKey`` would
fail on any non-Windows platform. Unfortunately, some applications try to
load attributes on every module in :data:`py3:sys.modules`. six mitigates
this problem for some applications by pretending attributes on unimportable
- modules don't exist. This hack doesn't work in every case, though. If you are
+ modules do not exist. This hack does not work in every case, though. If you are
encountering problems with the lazy modules and don't use any from imports
directly from ``six.moves`` modules, you can workaround the issue by removing
the six proxy modules::
@@ -548,139 +577,148 @@ functionality; its structure mimics the structure of the Python 3
Supported renames:
-+------------------------------+-------------------------------------+-------------------------------------+
-| Name | Python 2 name | Python 3 name |
-+==============================+=====================================+=====================================+
-| ``builtins`` | :mod:`py2:__builtin__` | :mod:`py3:builtins` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``configparser`` | :mod:`py2:ConfigParser` | :mod:`py3:configparser` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``copyreg`` | :mod:`py2:copy_reg` | :mod:`py3:copyreg` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``cPickle`` | :mod:`py2:cPickle` | :mod:`py3:pickle` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``cStringIO`` | :func:`py2:cStringIO.StringIO` | :class:`py3:io.StringIO` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``dbm_gnu`` | :func:`py2:gdbm` | :class:`py3:dbm.gnu` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``_dummy_thread`` | :mod:`py2:dummy_thread` | :mod:`py3:_dummy_thread` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``email_mime_multipart`` | :mod:`py2:email.MIMEMultipart` | :mod:`py3:email.mime.multipart` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``email_mime_nonmultipart`` | :mod:`py2:email.MIMENonMultipart` | :mod:`py3:email.mime.nonmultipart` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``email_mime_text`` | :mod:`py2:email.MIMEText` | :mod:`py3:email.mime.text` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``email_mime_base`` | :mod:`py2:email.MIMEBase` | :mod:`py3:email.mime.base` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``filter`` | :func:`py2:itertools.ifilter` | :func:`py3:filter` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``filterfalse`` | :func:`py2:itertools.ifilterfalse` | :func:`py3:itertools.filterfalse` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``getcwd`` | :func:`py2:os.getcwdu` | :func:`py3:os.getcwd` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``getcwdb`` | :func:`py2:os.getcwd` | :func:`py3:os.getcwdb` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``http_cookiejar`` | :mod:`py2:cookielib` | :mod:`py3:http.cookiejar` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``http_cookies`` | :mod:`py2:Cookie` | :mod:`py3:http.cookies` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``html_entities`` | :mod:`py2:htmlentitydefs` | :mod:`py3:html.entities` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``html_parser`` | :mod:`py2:HTMLParser` | :mod:`py3:html.parser` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``http_client`` | :mod:`py2:httplib` | :mod:`py3:http.client` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``BaseHTTPServer`` | :mod:`py2:BaseHTTPServer` | :mod:`py3:http.server` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``CGIHTTPServer`` | :mod:`py2:CGIHTTPServer` | :mod:`py3:http.server` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``SimpleHTTPServer`` | :mod:`py2:SimpleHTTPServer` | :mod:`py3:http.server` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``input`` | :func:`py2:raw_input` | :func:`py3:input` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``intern`` | :func:`py2:intern` | :func:`py3:sys.intern` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``map`` | :func:`py2:itertools.imap` | :func:`py3:map` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``queue`` | :mod:`py2:Queue` | :mod:`py3:queue` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``range`` | :func:`py2:xrange` | :func:`py3:range` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``reduce`` | :func:`py2:reduce` | :func:`py3:functools.reduce` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``reload_module`` | :func:`py2:reload` | :func:`py3:imp.reload`, |
-| | | :func:`py3:importlib.reload` |
-| | | on Python 3.4+ |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``reprlib`` | :mod:`py2:repr` | :mod:`py3:reprlib` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``shlex_quote`` | :mod:`py2:pipes.quote` | :mod:`py3:shlex.quote` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``socketserver`` | :mod:`py2:SocketServer` | :mod:`py3:socketserver` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``_thread`` | :mod:`py2:thread` | :mod:`py3:_thread` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter`` | :mod:`py2:Tkinter` | :mod:`py3:tkinter` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_dialog`` | :mod:`py2:Dialog` | :mod:`py3:tkinter.dialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_filedialog`` | :mod:`py2:FileDialog` | :mod:`py3:tkinter.FileDialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_scrolledtext`` | :mod:`py2:ScrolledText` | :mod:`py3:tkinter.scrolledtext` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_simpledialog`` | :mod:`py2:SimpleDialog` | :mod:`py3:tkinter.simpledialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_ttk`` | :mod:`py2:ttk` | :mod:`py3:tkinter.ttk` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_tix`` | :mod:`py2:Tix` | :mod:`py3:tkinter.tix` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_constants`` | :mod:`py2:Tkconstants` | :mod:`py3:tkinter.constants` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_dnd`` | :mod:`py2:Tkdnd` | :mod:`py3:tkinter.dnd` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_colorchooser`` | :mod:`py2:tkColorChooser` | :mod:`py3:tkinter.colorchooser` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_commondialog`` | :mod:`py2:tkCommonDialog` | :mod:`py3:tkinter.commondialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_tkfiledialog`` | :mod:`py2:tkFileDialog` | :mod:`py3:tkinter.filedialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_font`` | :mod:`py2:tkFont` | :mod:`py3:tkinter.font` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_messagebox`` | :mod:`py2:tkMessageBox` | :mod:`py3:tkinter.messagebox` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_tksimpledialog`` | :mod:`py2:tkSimpleDialog` | :mod:`py3:tkinter.simpledialog` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib.parse`` | See :mod:`six.moves.urllib.parse` | :mod:`py3:urllib.parse` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib.error`` | See :mod:`six.moves.urllib.error` | :mod:`py3:urllib.error` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib.request`` | See :mod:`six.moves.urllib.request` | :mod:`py3:urllib.request` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib.response`` | See :mod:`six.moves.urllib.response`| :mod:`py3:urllib.response` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib.robotparser`` | :mod:`py2:robotparser` | :mod:`py3:urllib.robotparser` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``urllib_robotparser`` | :mod:`py2:robotparser` | :mod:`py3:urllib.robotparser` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``UserDict`` | :class:`py2:UserDict.UserDict` | :class:`py3:collections.UserDict` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``UserList`` | :class:`py2:UserList.UserList` | :class:`py3:collections.UserList` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``UserString`` | :class:`py2:UserString.UserString` | :class:`py3:collections.UserString` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``winreg`` | :mod:`py2:_winreg` | :mod:`py3:winreg` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``xmlrpc_client`` | :mod:`py2:xmlrpclib` | :mod:`py3:xmlrpc.client` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``xmlrpc_server`` | :mod:`py2:SimpleXMLRPCServer` | :mod:`py3:xmlrpc.server` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``xrange`` | :func:`py2:xrange` | :func:`py3:range` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``zip`` | :func:`py2:itertools.izip` | :func:`py3:zip` |
-+------------------------------+-------------------------------------+-------------------------------------+
-| ``zip_longest`` | :func:`py2:itertools.izip_longest` | :func:`py3:itertools.zip_longest` |
-+------------------------------+-------------------------------------+-------------------------------------+
++------------------------------+-------------------------------------+---------------------------------------+
+| Name | Python 2 name | Python 3 name |
++==============================+=====================================+=======================================+
+| ``builtins`` | :mod:`py2:__builtin__` | :mod:`py3:builtins` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``configparser`` | :mod:`py2:ConfigParser` | :mod:`py3:configparser` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``copyreg`` | :mod:`py2:copy_reg` | :mod:`py3:copyreg` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``cPickle`` | :mod:`py2:cPickle` | :mod:`py3:pickle` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``cStringIO`` | :func:`py2:cStringIO.StringIO` | :class:`py3:io.StringIO` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``collections_abc`` | :mod:`py2:collections` | :mod:`py3:collections.abc` (3.3+) |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``dbm_gnu`` | :mod:`py2:gdbm` | :mod:`py3:dbm.gnu` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``dbm_ndbm`` | :mod:`py2:dbm` | :mod:`py3:dbm.ndbm` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``_dummy_thread`` | :mod:`py2:dummy_thread` | :mod:`py3:_dummy_thread` (< 3.9) |
+| | | :mod:`py3:_thread` (3.9+) |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``email_mime_base`` | :mod:`py2:email.MIMEBase` | :mod:`py3:email.mime.base` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``email_mime_image`` | :mod:`py2:email.MIMEImage` | :mod:`py3:email.mime.image` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``email_mime_multipart`` | :mod:`py2:email.MIMEMultipart` | :mod:`py3:email.mime.multipart` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``email_mime_nonmultipart`` | :mod:`py2:email.MIMENonMultipart` | :mod:`py3:email.mime.nonmultipart` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``email_mime_text`` | :mod:`py2:email.MIMEText` | :mod:`py3:email.mime.text` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``filter`` | :func:`py2:itertools.ifilter` | :func:`py3:filter` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``filterfalse`` | :func:`py2:itertools.ifilterfalse` | :func:`py3:itertools.filterfalse` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``getcwd`` | :func:`py2:os.getcwdu` | :func:`py3:os.getcwd` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``getcwdb`` | :func:`py2:os.getcwd` | :func:`py3:os.getcwdb` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``getoutput`` | :func:`py2:commands.getoutput` | :func:`py3:subprocess.getoutput` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``http_cookiejar`` | :mod:`py2:cookielib` | :mod:`py3:http.cookiejar` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``http_cookies`` | :mod:`py2:Cookie` | :mod:`py3:http.cookies` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``html_entities`` | :mod:`py2:htmlentitydefs` | :mod:`py3:html.entities` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``html_parser`` | :mod:`py2:HTMLParser` | :mod:`py3:html.parser` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``http_client`` | :mod:`py2:httplib` | :mod:`py3:http.client` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``BaseHTTPServer`` | :mod:`py2:BaseHTTPServer` | :mod:`py3:http.server` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``CGIHTTPServer`` | :mod:`py2:CGIHTTPServer` | :mod:`py3:http.server` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``SimpleHTTPServer`` | :mod:`py2:SimpleHTTPServer` | :mod:`py3:http.server` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``input`` | :func:`py2:raw_input` | :func:`py3:input` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``intern`` | :func:`py2:intern` | :func:`py3:sys.intern` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``map`` | :func:`py2:itertools.imap` | :func:`py3:map` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``queue`` | :mod:`py2:Queue` | :mod:`py3:queue` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``range`` | :func:`py2:xrange` | :func:`py3:range` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``reduce`` | :func:`py2:reduce` | :func:`py3:functools.reduce` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``reload_module`` | :func:`py2:reload` | :func:`py3:imp.reload`, |
+| | | :func:`py3:importlib.reload` |
+| | | on Python 3.4+ |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``reprlib`` | :mod:`py2:repr` | :mod:`py3:reprlib` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``shlex_quote`` | :mod:`py2:pipes.quote` | :mod:`py3:shlex.quote` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``socketserver`` | :mod:`py2:SocketServer` | :mod:`py3:socketserver` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``_thread`` | :mod:`py2:thread` | :mod:`py3:_thread` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter`` | :mod:`py2:Tkinter` | :mod:`py3:tkinter` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_dialog`` | :mod:`py2:Dialog` | :mod:`py3:tkinter.dialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_filedialog`` | :mod:`py2:FileDialog` | :mod:`py3:tkinter.FileDialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_scrolledtext`` | :mod:`py2:ScrolledText` | :mod:`py3:tkinter.scrolledtext` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_simpledialog`` | :mod:`py2:SimpleDialog` | :mod:`py3:tkinter.simpledialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_ttk`` | :mod:`py2:ttk` | :mod:`py3:tkinter.ttk` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_tix`` | :mod:`py2:Tix` | :mod:`py3:tkinter.tix` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_constants`` | :mod:`py2:Tkconstants` | :mod:`py3:tkinter.constants` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_dnd`` | :mod:`py2:Tkdnd` | :mod:`py3:tkinter.dnd` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_colorchooser`` | :mod:`py2:tkColorChooser` | :mod:`py3:tkinter.colorchooser` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_commondialog`` | :mod:`py2:tkCommonDialog` | :mod:`py3:tkinter.commondialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_tkfiledialog`` | :mod:`py2:tkFileDialog` | :mod:`py3:tkinter.filedialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_font`` | :mod:`py2:tkFont` | :mod:`py3:tkinter.font` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_messagebox`` | :mod:`py2:tkMessageBox` | :mod:`py3:tkinter.messagebox` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``tkinter_tksimpledialog`` | :mod:`py2:tkSimpleDialog` | :mod:`py3:tkinter.simpledialog` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib.parse`` | See :mod:`six.moves.urllib.parse` | :mod:`py3:urllib.parse` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib.error`` | See :mod:`six.moves.urllib.error` | :mod:`py3:urllib.error` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib.request`` | See :mod:`six.moves.urllib.request` | :mod:`py3:urllib.request` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib.response`` | See :mod:`six.moves.urllib.response`| :mod:`py3:urllib.response` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib.robotparser`` | :mod:`py2:robotparser` | :mod:`py3:urllib.robotparser` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``urllib_robotparser`` | :mod:`py2:robotparser` | :mod:`py3:urllib.robotparser` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``UserDict`` | :class:`py2:UserDict.UserDict` | :class:`py3:collections.UserDict` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``UserList`` | :class:`py2:UserList.UserList` | :class:`py3:collections.UserList` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``UserString`` | :class:`py2:UserString.UserString` | :class:`py3:collections.UserString` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``winreg`` | :mod:`py2:_winreg` | :mod:`py3:winreg` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``xmlrpc_client`` | :mod:`py2:xmlrpclib` | :mod:`py3:xmlrpc.client` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``xmlrpc_server`` | :mod:`py2:SimpleXMLRPCServer` | :mod:`py3:xmlrpc.server` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``xrange`` | :func:`py2:xrange` | :func:`py3:range` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``zip`` | :func:`py2:itertools.izip` | :func:`py3:zip` |
++------------------------------+-------------------------------------+---------------------------------------+
+| ``zip_longest`` | :func:`py2:itertools.izip_longest` | :func:`py3:itertools.zip_longest` |
++------------------------------+-------------------------------------+---------------------------------------+
urllib parse
<<<<<<<<<<<<
@@ -715,7 +753,8 @@ and :mod:`py2:urllib`:
* :func:`py2:urllib.quote_plus`
* :func:`py2:urllib.splittag`
* :func:`py2:urllib.splituser`
-* :func:`py2:urllib.unquote`
+* :func:`py2:urllib.splitvalue`
+* :func:`py2:urllib.unquote` (also exposed as :func:`py3:urllib.parse.unquote_to_bytes`)
* :func:`py2:urllib.unquote_plus`
* :func:`py2:urllib.urlencode`
@@ -762,6 +801,8 @@ and :mod:`py2:urllib2`:
* :func:`py2:urllib2.urlopen`
* :func:`py2:urllib2.install_opener`
* :func:`py2:urllib2.build_opener`
+* :func:`py2:urllib2.parse_http_list`
+* :func:`py2:urllib2.parse_keqv_list`
* :class:`py2:urllib2.Request`
* :class:`py2:urllib2.OpenerDirector`
* :class:`py2:urllib2.HTTPDefaultErrorHandler`
diff --git a/chromium/third_party/catapult/third_party/six/setup.cfg b/chromium/third_party/catapult/third_party/six/setup.cfg
index 4a5b8473d03..fb1f5367a48 100644
--- a/chromium/third_party/catapult/third_party/six/setup.cfg
+++ b/chromium/third_party/catapult/third_party/six/setup.cfg
@@ -1,18 +1,24 @@
-[wheel]
+[bdist_wheel]
universal = 1
[flake8]
max-line-length = 100
ignore = F821
-[pytest]
-minversion=2.2.0
-pep8ignore =
- documentation/*.py ALL
- test_six.py ALL
+[metadata]
+license_file = LICENSE
-flakes-ignore =
- documentation/*.py ALL
- test_six.py ALL
- six.py UndefinedName
+[tool:pytest]
+minversion = 2.2.0
+pep8ignore =
+ documentation/*.py ALL
+ test_six.py ALL
+flakes-ignore =
+ documentation/*.py ALL
+ test_six.py ALL
+ six.py UndefinedName
+
+[egg_info]
+tag_build =
+tag_date = 0
diff --git a/chromium/third_party/catapult/third_party/six/setup.py b/chromium/third_party/catapult/third_party/six/setup.py
index 31d4625cf4c..d90958b69d3 100644
--- a/chromium/third_party/catapult/third_party/six/setup.py
+++ b/chromium/third_party/catapult/third_party/six/setup.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2015 Benjamin Peterson
+# Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -20,6 +20,9 @@
from __future__ import with_statement
+# Six is a dependency of setuptools, so using setuptools creates a
+# circular dependency when building a Python stack from source. We
+# therefore allow falling back to distutils to install six.
try:
from setuptools import setup
except ImportError:
@@ -28,6 +31,7 @@ except ImportError:
import six
six_classifiers = [
+ "Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
@@ -36,17 +40,19 @@ six_classifiers = [
"Topic :: Utilities",
]
-with open("README", "r") as fp:
+with open("README.rst", "r") as fp:
six_long_description = fp.read()
setup(name="six",
version=six.__version__,
author="Benjamin Peterson",
author_email="benjamin@python.org",
- url="http://pypi.python.org/pypi/six/",
+ url="https://github.com/benjaminp/six",
+ tests_require=["pytest"],
py_modules=["six"],
description="Python 2 and 3 compatibility utilities",
long_description=six_long_description,
license="MIT",
- classifiers=six_classifiers
+ classifiers=six_classifiers,
+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
)
diff --git a/chromium/third_party/catapult/third_party/six/six.egg-info/PKG-INFO b/chromium/third_party/catapult/third_party/six/six.egg-info/PKG-INFO
new file mode 100644
index 00000000000..1e57620bb60
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/six.egg-info/PKG-INFO
@@ -0,0 +1,47 @@
+Metadata-Version: 1.2
+Name: six
+Version: 1.16.0
+Summary: Python 2 and 3 compatibility utilities
+Home-page: https://github.com/benjaminp/six
+Author: Benjamin Peterson
+Author-email: benjamin@python.org
+License: MIT
+Description: .. image:: https://img.shields.io/pypi/v/six.svg
+ :target: https://pypi.org/project/six/
+ :alt: six on PyPI
+
+ .. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
+ :target: https://travis-ci.org/benjaminp/six
+ :alt: six on TravisCI
+
+ .. image:: https://readthedocs.org/projects/six/badge/?version=latest
+ :target: https://six.readthedocs.io/
+ :alt: six's documentation on Read the Docs
+
+ .. image:: https://img.shields.io/badge/license-MIT-green.svg
+ :target: https://github.com/benjaminp/six/blob/master/LICENSE
+ :alt: MIT License badge
+
+ Six is a Python 2 and 3 compatibility library. It provides utility functions
+ for smoothing over the differences between the Python versions with the goal of
+ writing Python code that is compatible on both Python versions. See the
+ documentation for more information on what is provided.
+
+ Six supports Python 2.7 and 3.3+. It is contained in only one Python
+ file, so it can be easily copied into your project. (The copyright and license
+ notice must be retained.)
+
+ Online documentation is at https://six.readthedocs.io/.
+
+ Bugs can be reported to https://github.com/benjaminp/six. The code can also
+ be found there.
+
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Topic :: Utilities
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*
diff --git a/chromium/third_party/catapult/third_party/six/six.egg-info/SOURCES.txt b/chromium/third_party/catapult/third_party/six/six.egg-info/SOURCES.txt
new file mode 100644
index 00000000000..9a7f3dec6df
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/six.egg-info/SOURCES.txt
@@ -0,0 +1,15 @@
+CHANGES
+LICENSE
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+six.py
+test_six.py
+documentation/Makefile
+documentation/conf.py
+documentation/index.rst
+six.egg-info/PKG-INFO
+six.egg-info/SOURCES.txt
+six.egg-info/dependency_links.txt
+six.egg-info/top_level.txt \ No newline at end of file
diff --git a/chromium/third_party/catapult/third_party/six/six.egg-info/dependency_links.txt b/chromium/third_party/catapult/third_party/six/six.egg-info/dependency_links.txt
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/six.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/chromium/third_party/catapult/third_party/six/six.egg-info/top_level.txt b/chromium/third_party/catapult/third_party/six/six.egg-info/top_level.txt
new file mode 100644
index 00000000000..ffe2fce4989
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/six/six.egg-info/top_level.txt
@@ -0,0 +1 @@
+six
diff --git a/chromium/third_party/catapult/third_party/six/six.py b/chromium/third_party/catapult/third_party/six/six.py
index 336e8a1cbb8..4e15675d8b5 100644
--- a/chromium/third_party/catapult/third_party/six/six.py
+++ b/chromium/third_party/catapult/third_party/six/six.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2015 Benjamin Peterson
+# Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -29,11 +29,7 @@ import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
-__version__ = "1.10.0"
-
-
-# pylint: disable-all
-# pylint: skip-file
+__version__ = "1.16.0"
# Useful for very coarse version differentiation.
@@ -75,6 +71,11 @@ else:
MAXSIZE = int((1 << 63) - 1)
del X
+if PY34:
+ from importlib.util import spec_from_loader
+else:
+ spec_from_loader = None
+
def _add_doc(func, doc):
"""Add documentation to a function."""
@@ -190,6 +191,11 @@ class _SixMetaPathImporter(object):
return self
return None
+ def find_spec(self, fullname, path, target=None):
+ if fullname in self.known_modules:
+ return spec_from_loader(fullname, self)
+ return None
+
def __get_module(self, fullname):
try:
return self.known_modules[fullname]
@@ -227,6 +233,12 @@ class _SixMetaPathImporter(object):
return None
get_source = get_code # same as get_code
+ def create_module(self, spec):
+ return self.load_module(spec.name)
+
+ def exec_module(self, module):
+ pass
+
_importer = _SixMetaPathImporter(__name__)
@@ -245,6 +257,7 @@ _moved_attributes = [
MovedAttribute("map", "itertools", "builtins", "imap", "map"),
MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"),
MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"),
+ MovedAttribute("getoutput", "commands", "subprocess"),
MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"),
MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"),
MovedAttribute("reduce", "__builtin__", "functools"),
@@ -258,18 +271,21 @@ _moved_attributes = [
MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"),
MovedModule("builtins", "__builtin__"),
MovedModule("configparser", "ConfigParser"),
+ MovedModule("collections_abc", "collections", "collections.abc" if sys.version_info >= (3, 3) else "collections"),
MovedModule("copyreg", "copy_reg"),
MovedModule("dbm_gnu", "gdbm", "dbm.gnu"),
- MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"),
+ MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"),
+ MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if sys.version_info < (3, 9) else "_thread"),
MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
MovedModule("http_cookies", "Cookie", "http.cookies"),
MovedModule("html_entities", "htmlentitydefs", "html.entities"),
MovedModule("html_parser", "HTMLParser", "html.parser"),
MovedModule("http_client", "httplib", "http.client"),
+ MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
+ MovedModule("email_mime_image", "email.MIMEImage", "email.mime.image"),
MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"),
MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"),
MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"),
- MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"),
MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"),
MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"),
@@ -341,10 +357,12 @@ _urllib_parse_moved_attributes = [
MovedAttribute("quote_plus", "urllib", "urllib.parse"),
MovedAttribute("unquote", "urllib", "urllib.parse"),
MovedAttribute("unquote_plus", "urllib", "urllib.parse"),
+ MovedAttribute("unquote_to_bytes", "urllib", "urllib.parse", "unquote", "unquote_to_bytes"),
MovedAttribute("urlencode", "urllib", "urllib.parse"),
MovedAttribute("splitquery", "urllib", "urllib.parse"),
MovedAttribute("splittag", "urllib", "urllib.parse"),
MovedAttribute("splituser", "urllib", "urllib.parse"),
+ MovedAttribute("splitvalue", "urllib", "urllib.parse"),
MovedAttribute("uses_fragment", "urlparse", "urllib.parse"),
MovedAttribute("uses_netloc", "urlparse", "urllib.parse"),
MovedAttribute("uses_params", "urlparse", "urllib.parse"),
@@ -420,6 +438,8 @@ _urllib_request_moved_attributes = [
MovedAttribute("URLopener", "urllib", "urllib.request"),
MovedAttribute("FancyURLopener", "urllib", "urllib.request"),
MovedAttribute("proxy_bypass", "urllib", "urllib.request"),
+ MovedAttribute("parse_http_list", "urllib2", "urllib.request"),
+ MovedAttribute("parse_keqv_list", "urllib2", "urllib.request"),
]
for attr in _urllib_request_moved_attributes:
setattr(Module_six_moves_urllib_request, attr.name, attr)
@@ -635,13 +655,16 @@ if PY3:
import io
StringIO = io.StringIO
BytesIO = io.BytesIO
+ del io
_assertCountEqual = "assertCountEqual"
if sys.version_info[1] <= 1:
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
+ _assertNotRegex = "assertNotRegexpMatches"
else:
_assertRaisesRegex = "assertRaisesRegex"
_assertRegex = "assertRegex"
+ _assertNotRegex = "assertNotRegex"
else:
def b(s):
return s
@@ -663,6 +686,7 @@ else:
_assertCountEqual = "assertItemsEqual"
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
+ _assertNotRegex = "assertNotRegexpMatches"
_add_doc(b, """Byte literal""")
_add_doc(u, """Text literal""")
@@ -679,15 +703,23 @@ def assertRegex(self, *args, **kwargs):
return getattr(self, _assertRegex)(*args, **kwargs)
+def assertNotRegex(self, *args, **kwargs):
+ return getattr(self, _assertNotRegex)(*args, **kwargs)
+
+
if PY3:
exec_ = getattr(moves.builtins, "exec")
def reraise(tp, value, tb=None):
- if value is None:
- value = tp()
- if value.__traceback__ is not tb:
- raise value.with_traceback(tb)
- raise value
+ try:
+ if value is None:
+ value = tp()
+ if value.__traceback__ is not tb:
+ raise value.with_traceback(tb)
+ raise value
+ finally:
+ value = None
+ tb = None
else:
def exec_(_code_, _globs_=None, _locs_=None):
@@ -703,19 +735,19 @@ else:
exec("""exec _code_ in _globs_, _locs_""")
exec_("""def reraise(tp, value, tb=None):
- raise tp, value, tb
+ try:
+ raise tp, value, tb
+ finally:
+ tb = None
""")
-if sys.version_info[:2] == (3, 2):
+if sys.version_info[:2] > (3,):
exec_("""def raise_from(value, from_value):
- if from_value is None:
- raise value
- raise value from from_value
-""")
-elif sys.version_info[:2] > (3, 2):
- exec_("""def raise_from(value, from_value):
- raise value from from_value
+ try:
+ raise value from from_value
+ finally:
+ value = None
""")
else:
def raise_from(value, from_value):
@@ -790,13 +822,33 @@ if sys.version_info[:2] < (3, 3):
_add_doc(reraise, """Reraise an exception.""")
if sys.version_info[0:2] < (3, 4):
+ # This does exactly the same what the :func:`py3:functools.update_wrapper`
+ # function does on Python versions after 3.2. It sets the ``__wrapped__``
+ # attribute on ``wrapper`` object and it doesn't raise an error if any of
+ # the attributes mentioned in ``assigned`` and ``updated`` are missing on
+ # ``wrapped`` object.
+ def _update_wrapper(wrapper, wrapped,
+ assigned=functools.WRAPPER_ASSIGNMENTS,
+ updated=functools.WRAPPER_UPDATES):
+ for attr in assigned:
+ try:
+ value = getattr(wrapped, attr)
+ except AttributeError:
+ continue
+ else:
+ setattr(wrapper, attr, value)
+ for attr in updated:
+ getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
+ wrapper.__wrapped__ = wrapped
+ return wrapper
+ _update_wrapper.__doc__ = functools.update_wrapper.__doc__
+
def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
updated=functools.WRAPPER_UPDATES):
- def wrapper(f):
- f = functools.wraps(wrapped, assigned, updated)(f)
- f.__wrapped__ = wrapped
- return f
- return wrapper
+ return functools.partial(_update_wrapper, wrapped=wrapped,
+ assigned=assigned, updated=updated)
+ wraps.__doc__ = functools.wraps.__doc__
+
else:
wraps = functools.wraps
@@ -806,10 +858,22 @@ def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
- class metaclass(meta):
+ class metaclass(type):
def __new__(cls, name, this_bases, d):
- return meta(name, bases, d)
+ if sys.version_info[:2] >= (3, 7):
+ # This version introduced PEP 560 that requires a bit
+ # of extra care (we mimic what is done by __build_class__).
+ resolved_bases = types.resolve_bases(bases)
+ if resolved_bases is not bases:
+ d['__orig_bases__'] = bases
+ else:
+ resolved_bases = bases
+ return meta(name, resolved_bases, d)
+
+ @classmethod
+ def __prepare__(cls, name, this_bases):
+ return meta.__prepare__(name, bases)
return type.__new__(metaclass, 'temporary_class', (), {})
@@ -825,13 +889,75 @@ def add_metaclass(metaclass):
orig_vars.pop(slots_var)
orig_vars.pop('__dict__', None)
orig_vars.pop('__weakref__', None)
+ if hasattr(cls, '__qualname__'):
+ orig_vars['__qualname__'] = cls.__qualname__
return metaclass(cls.__name__, cls.__bases__, orig_vars)
return wrapper
+def ensure_binary(s, encoding='utf-8', errors='strict'):
+ """Coerce **s** to six.binary_type.
+
+ For Python 2:
+ - `unicode` -> encoded to `str`
+ - `str` -> `str`
+
+ For Python 3:
+ - `str` -> encoded to `bytes`
+ - `bytes` -> `bytes`
+ """
+ if isinstance(s, binary_type):
+ return s
+ if isinstance(s, text_type):
+ return s.encode(encoding, errors)
+ raise TypeError("not expecting type '%s'" % type(s))
+
+
+def ensure_str(s, encoding='utf-8', errors='strict'):
+ """Coerce *s* to `str`.
+
+ For Python 2:
+ - `unicode` -> encoded to `str`
+ - `str` -> `str`
+
+ For Python 3:
+ - `str` -> `str`
+ - `bytes` -> decoded to `str`
+ """
+ # Optimization: Fast return for the common case.
+ if type(s) is str:
+ return s
+ if PY2 and isinstance(s, text_type):
+ return s.encode(encoding, errors)
+ elif PY3 and isinstance(s, binary_type):
+ return s.decode(encoding, errors)
+ elif not isinstance(s, (text_type, binary_type)):
+ raise TypeError("not expecting type '%s'" % type(s))
+ return s
+
+
+def ensure_text(s, encoding='utf-8', errors='strict'):
+ """Coerce *s* to six.text_type.
+
+ For Python 2:
+ - `unicode` -> `unicode`
+ - `str` -> `unicode`
+
+ For Python 3:
+ - `str` -> `str`
+ - `bytes` -> decoded to `str`
+ """
+ if isinstance(s, binary_type):
+ return s.decode(encoding, errors)
+ elif isinstance(s, text_type):
+ return s
+ else:
+ raise TypeError("not expecting type '%s'" % type(s))
+
+
def python_2_unicode_compatible(klass):
"""
- A decorator that defines __unicode__ and __str__ methods under Python 2.
+ A class decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
To support Python 2 and 3 with a single code base, define a __str__ method
diff --git a/chromium/third_party/catapult/third_party/six/test_six.py b/chromium/third_party/catapult/third_party/six/test_six.py
index b68e0069d05..7b8b03b5e61 100644
--- a/chromium/third_party/catapult/third_party/six/test_six.py
+++ b/chromium/third_party/catapult/third_party/six/test_six.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2015 Benjamin Peterson
+# Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -22,8 +22,9 @@ import operator
import sys
import types
import unittest
+import abc
-import py
+import pytest
import six
@@ -80,7 +81,7 @@ def test_MAXSIZE():
except AttributeError:
# Before Python 2.6.
pass
- py.test.raises(
+ pytest.raises(
(ValueError, OverflowError),
operator.mul, [None], six.MAXSIZE + 1)
@@ -112,7 +113,7 @@ except ImportError:
except ImportError:
have_gdbm = False
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._moved_attributes])
def test_move_items(item_name):
"""Ensure that everything loads correctly."""
@@ -120,70 +121,55 @@ def test_move_items(item_name):
item = getattr(six.moves, item_name)
if isinstance(item, types.ModuleType):
__import__("six.moves." + item_name)
- except AttributeError:
- if item_name == "zip_longest" and sys.version_info < (2, 6):
- py.test.skip("zip_longest only available on 2.6+")
except ImportError:
if item_name == "winreg" and not sys.platform.startswith("win"):
- py.test.skip("Windows only module")
+ pytest.skip("Windows only module")
if item_name.startswith("tkinter"):
if not have_tkinter:
- py.test.skip("requires tkinter")
- if item_name == "tkinter_ttk" and sys.version_info[:2] <= (2, 6):
- py.test.skip("ttk only available on 2.7+")
+ pytest.skip("requires tkinter")
if item_name.startswith("dbm_gnu") and not have_gdbm:
- py.test.skip("requires gdbm")
+ pytest.skip("requires gdbm")
raise
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves)
+ assert item_name in dir(six.moves)
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._urllib_parse_moved_attributes])
def test_move_items_urllib_parse(item_name):
"""Ensure that everything loads correctly."""
- if item_name == "ParseResult" and sys.version_info < (2, 5):
- py.test.skip("ParseResult is only found on 2.5+")
- if item_name in ("parse_qs", "parse_qsl") and sys.version_info < (2, 6):
- py.test.skip("parse_qs[l] is new in 2.6")
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves.urllib.parse)
+ assert item_name in dir(six.moves.urllib.parse)
getattr(six.moves.urllib.parse, item_name)
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._urllib_error_moved_attributes])
def test_move_items_urllib_error(item_name):
"""Ensure that everything loads correctly."""
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves.urllib.error)
+ assert item_name in dir(six.moves.urllib.error)
getattr(six.moves.urllib.error, item_name)
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._urllib_request_moved_attributes])
def test_move_items_urllib_request(item_name):
"""Ensure that everything loads correctly."""
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves.urllib.request)
+ assert item_name in dir(six.moves.urllib.request)
getattr(six.moves.urllib.request, item_name)
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._urllib_response_moved_attributes])
def test_move_items_urllib_response(item_name):
"""Ensure that everything loads correctly."""
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves.urllib.response)
+ assert item_name in dir(six.moves.urllib.response)
getattr(six.moves.urllib.response, item_name)
-@py.test.mark.parametrize("item_name",
+@pytest.mark.parametrize("item_name",
[item.name for item in six._urllib_robotparser_moved_attributes])
def test_move_items_urllib_robotparser(item_name):
"""Ensure that everything loads correctly."""
- if sys.version_info[:2] >= (2, 6):
- assert item_name in dir(six.moves.urllib.robotparser)
+ assert item_name in dir(six.moves.urllib.robotparser)
getattr(six.moves.urllib.robotparser, item_name)
@@ -232,12 +218,17 @@ def test_map():
assert six.advance_iterator(map(lambda x: x + 1, range(2))) == 1
+def test_getoutput():
+ from six.moves import getoutput
+ output = getoutput('echo "foo"')
+ assert output == 'foo'
+
+
def test_zip():
from six.moves import zip
assert six.advance_iterator(zip(range(2), range(2))) == (0, 0)
-@py.test.mark.skipif("sys.version_info < (2, 6)")
def test_zip_longest():
from six.moves import zip_longest
it = zip_longest(range(2), range(1))
@@ -315,7 +306,7 @@ class TestCustomizedMoves:
def test_empty_remove(self):
- py.test.raises(AttributeError, six.remove_move, "eggs")
+ pytest.raises(AttributeError, six.remove_move, "eggs")
def test_get_unbound_function():
@@ -331,7 +322,7 @@ def test_get_method_self():
pass
x = X()
assert six.get_method_self(x.m) is x
- py.test.raises(AttributeError, six.get_method_self, 42)
+ pytest.raises(AttributeError, six.get_method_self, 42)
def test_get_method_function():
@@ -340,7 +331,7 @@ def test_get_method_function():
pass
x = X()
assert six.get_method_function(x.m) is X.__dict__["m"]
- py.test.raises(AttributeError, six.get_method_function, hasattr)
+ pytest.raises(AttributeError, six.get_method_function, hasattr)
def test_get_function_closure():
@@ -358,7 +349,7 @@ def test_get_function_code():
pass
assert isinstance(six.get_function_code(f), types.CodeType)
if not hasattr(sys, "pypy_version_info"):
- py.test.raises(AttributeError, six.get_function_code, hasattr)
+ pytest.raises(AttributeError, six.get_function_code, hasattr)
def test_get_function_defaults():
@@ -398,7 +389,7 @@ def test_dictionary_iterators(monkeypatch):
it = meth(d)
assert not isinstance(it, list)
assert list(it) == list(getattr(d, name)())
- py.test.raises(StopIteration, six.advance_iterator, it)
+ pytest.raises(StopIteration, six.advance_iterator, it)
record = []
def with_kw(*args, **kw):
record.append(kw["kw"])
@@ -410,17 +401,7 @@ def test_dictionary_iterators(monkeypatch):
monkeypatch.undo()
-@py.test.mark.skipif("sys.version_info[:2] < (2, 7)",
- reason="view methods on dictionaries only available on 2.7+")
def test_dictionary_views():
- def stock_method_name(viewwhat):
- """Given a method suffix like "keys" or "values", return the name
- of the dict method that delivers those on the version of Python
- we're running in."""
- if six.PY3:
- return viewwhat
- return 'view' + viewwhat
-
d = dict(zip(range(10), (range(11, 20))))
for name in "keys", "values", "items":
meth = getattr(six, "view" + name)
@@ -434,8 +415,8 @@ def test_advance_iterator():
it = iter(l)
assert six.next(it) == 1
assert six.next(it) == 2
- py.test.raises(StopIteration, six.next, it)
- py.test.raises(StopIteration, six.next, it)
+ pytest.raises(StopIteration, six.next, it)
+ pytest.raises(StopIteration, six.next, it)
def test_iterator():
@@ -483,7 +464,7 @@ def test_create_unbound_method():
def f(self):
return self
u = six.create_unbound_method(f, X)
- py.test.raises(TypeError, u)
+ pytest.raises(TypeError, u)
if six.PY2:
assert isinstance(u, types.MethodType)
x = X()
@@ -531,13 +512,13 @@ def test_unichr():
def test_int2byte():
assert six.int2byte(3) == six.b("\x03")
- py.test.raises(Exception, six.int2byte, 256)
+ pytest.raises(Exception, six.int2byte, 256)
def test_byte2int():
assert six.byte2int(six.b("\x03")) == 3
assert six.byte2int(six.b("\x03\x04")) == 3
- py.test.raises(IndexError, six.byte2int, six.b(""))
+ pytest.raises(IndexError, six.byte2int, six.b(""))
def test_bytesindex():
@@ -548,7 +529,7 @@ def test_bytesiter():
it = six.iterbytes(six.b("hi"))
assert six.next(it) == ord("h")
assert six.next(it) == ord("i")
- py.test.raises(StopIteration, six.next, it)
+ pytest.raises(StopIteration, six.next, it)
def test_StringIO():
@@ -637,7 +618,6 @@ def test_raise_from():
# We should have done a raise f from None equivalent.
assert val.__cause__ is None
assert val.__context__ is ctx
- if sys.version_info[:2] >= (3, 3):
# And that should suppress the context on the exception.
assert val.__suppress_context__
# For all versions the outer exception should have raised successfully.
@@ -683,28 +663,10 @@ def test_print_():
assert out.flushed
-@py.test.mark.skipif("sys.version_info[:2] >= (2, 6)")
-def test_print_encoding(monkeypatch):
- # Fool the type checking in print_.
- monkeypatch.setattr(six, "file", six.BytesIO, raising=False)
- out = six.BytesIO()
- out.encoding = "utf-8"
- out.errors = None
- six.print_(six.u("\u053c"), end="", file=out)
- assert out.getvalue() == six.b("\xd4\xbc")
- out = six.BytesIO()
- out.encoding = "ascii"
- out.errors = "strict"
- py.test.raises(UnicodeEncodeError, six.print_, six.u("\u053c"), file=out)
- out.errors = "backslashreplace"
- six.print_(six.u("\u053c"), end="", file=out)
- assert out.getvalue() == six.b("\\u053c")
-
-
def test_print_exceptions():
- py.test.raises(TypeError, six.print_, x=3)
- py.test.raises(TypeError, six.print_, end=3)
- py.test.raises(TypeError, six.print_, sep=42)
+ pytest.raises(TypeError, six.print_, x=3)
+ pytest.raises(TypeError, six.print_, end=3)
+ pytest.raises(TypeError, six.print_, sep=42)
def test_with_metaclass():
@@ -728,6 +690,88 @@ def test_with_metaclass():
assert issubclass(X, Base)
assert issubclass(X, Base2)
assert X.__mro__ == (X, Base, Base2, object)
+ class X(six.with_metaclass(Meta)):
+ pass
+ class MetaSub(Meta):
+ pass
+ class Y(six.with_metaclass(MetaSub, X)):
+ pass
+ assert type(Y) is MetaSub
+ assert Y.__mro__ == (Y, X, object)
+
+
+def test_with_metaclass_typing():
+ try:
+ import typing
+ except ImportError:
+ pytest.skip("typing module required")
+ class Meta(type):
+ pass
+ if sys.version_info[:2] < (3, 7):
+ # Generics with custom metaclasses were broken on older versions.
+ class Meta(Meta, typing.GenericMeta):
+ pass
+ T = typing.TypeVar('T')
+ class G(six.with_metaclass(Meta, typing.Generic[T])):
+ pass
+ class GA(six.with_metaclass(abc.ABCMeta, typing.Generic[T])):
+ pass
+ assert isinstance(G, Meta)
+ assert isinstance(GA, abc.ABCMeta)
+ assert G[int] is not G[G[int]]
+ assert GA[int] is not GA[GA[int]]
+ assert G.__bases__ == (typing.Generic,)
+ assert G.__orig_bases__ == (typing.Generic[T],)
+
+
+@pytest.mark.skipif("sys.version_info[:2] < (3, 7)")
+def test_with_metaclass_pep_560():
+ class Meta(type):
+ pass
+ class A:
+ pass
+ class B:
+ pass
+ class Fake:
+ def __mro_entries__(self, bases):
+ return (A, B)
+ fake = Fake()
+ class G(six.with_metaclass(Meta, fake)):
+ pass
+ class GA(six.with_metaclass(abc.ABCMeta, fake)):
+ pass
+ assert isinstance(G, Meta)
+ assert isinstance(GA, abc.ABCMeta)
+ assert G.__bases__ == (A, B)
+ assert G.__orig_bases__ == (fake,)
+
+
+@pytest.mark.skipif("sys.version_info[:2] < (3, 0)")
+def test_with_metaclass_prepare():
+ """Test that with_metaclass causes Meta.__prepare__ to be called with the correct arguments."""
+
+ class MyDict(dict):
+ pass
+
+ class Meta(type):
+
+ @classmethod
+ def __prepare__(cls, name, bases):
+ namespace = MyDict(super().__prepare__(name, bases), cls=cls, bases=bases)
+ namespace['namespace'] = namespace
+ return namespace
+
+ class Base(object):
+ pass
+
+ bases = (Base,)
+
+ class X(six.with_metaclass(Meta, *bases)):
+ pass
+
+ assert getattr(X, 'cls', type) is Meta
+ assert getattr(X, 'bases', ()) == bases
+ assert isinstance(getattr(X, 'namespace', {}), MyDict)
def test_wraps():
@@ -750,14 +794,33 @@ def test_wraps():
def f(g, assign, update):
def w():
return 42
- w.glue = {"foo" : "bar"}
+ w.glue = {"foo": "bar"}
+ w.xyzzy = {"qux": "quux"}
return six.wraps(g, assign, update)(w)
- k.glue = {"melon" : "egg"}
+ k.glue = {"melon": "egg"}
k.turnip = 43
- k = f(k, ["turnip"], ["glue"])
+ k = f(k, ["turnip", "baz"], ["glue", "xyzzy"])
assert k.__name__ == "w"
assert k.turnip == 43
- assert k.glue == {"melon" : "egg", "foo" : "bar"}
+ assert not hasattr(k, "baz")
+ assert k.glue == {"melon": "egg", "foo": "bar"}
+ assert k.xyzzy == {"qux": "quux"}
+
+
+def test_wraps_raises_on_missing_updated_field_on_wrapper():
+ """Ensure six.wraps doesn't ignore missing attrs wrapper.
+
+ Because that's what happens in Py3's functools.update_wrapper.
+ """
+ def wrapped():
+ pass
+
+ def wrapper():
+ pass
+
+ with pytest.raises(AttributeError, match='has no attribute.*xyzzy'):
+ six.wraps(wrapped, [], ['xyzzy'])(wrapper)
+
def test_add_metaclass():
@@ -815,7 +878,7 @@ def test_add_metaclass():
assert MySlots.__slots__ == ["a", "b"]
instance = MySlots()
instance.a = "foo"
- py.test.raises(AttributeError, setattr, instance, "c", "baz")
+ pytest.raises(AttributeError, setattr, instance, "c", "baz")
# Test a class with string for slots.
class MyStringSlots(object):
@@ -824,8 +887,8 @@ def test_add_metaclass():
assert MyStringSlots.__slots__ == "ab"
instance = MyStringSlots()
instance.ab = "foo"
- py.test.raises(AttributeError, setattr, instance, "a", "baz")
- py.test.raises(AttributeError, setattr, instance, "b", "baz")
+ pytest.raises(AttributeError, setattr, instance, "a", "baz")
+ pytest.raises(AttributeError, setattr, instance, "b", "baz")
class MySlotsWeakref(object):
__slots__ = "__weakref__",
@@ -833,7 +896,26 @@ def test_add_metaclass():
assert type(MySlotsWeakref) is Meta
-@py.test.mark.skipif("sys.version_info[:2] < (2, 7) or sys.version_info[:2] in ((3, 0), (3, 1))")
+@pytest.mark.skipif("sys.version_info[:2] < (3, 3)")
+def test_add_metaclass_nested():
+ # Regression test for https://github.com/benjaminp/six/issues/259
+ class Meta(type):
+ pass
+
+ class A:
+ class B: pass
+
+ expected = 'test_add_metaclass_nested.<locals>.A.B'
+
+ assert A.B.__qualname__ == expected
+
+ class A:
+ @six.add_metaclass(Meta)
+ class B: pass
+
+ assert A.B.__qualname__ == expected
+
+
def test_assertCountEqual():
class TestAssertCountEqual(unittest.TestCase):
def test(self):
@@ -845,7 +927,6 @@ def test_assertCountEqual():
TestAssertCountEqual('test').test()
-@py.test.mark.skipif("sys.version_info[:2] < (2, 7)")
def test_assertRegex():
class TestAssertRegex(unittest.TestCase):
def test(self):
@@ -857,7 +938,17 @@ def test_assertRegex():
TestAssertRegex('test').test()
-@py.test.mark.skipif("sys.version_info[:2] < (2, 7)")
+def test_assertNotRegex():
+ class TestAssertNotRegex(unittest.TestCase):
+ def test(self):
+ with self.assertRaises(AssertionError):
+ six.assertNotRegex(self, 'test', r'^t')
+
+ six.assertNotRegex(self, 'test', r'^a')
+
+ TestAssertNotRegex('test').test()
+
+
def test_assertRaisesRegex():
class TestAssertRaisesRegex(unittest.TestCase):
def test(self):
@@ -890,3 +981,61 @@ def test_python_2_unicode_compatible():
assert str(my_test) == six.u("hello")
assert getattr(six.moves.builtins, 'bytes', str)(my_test) == six.b("hello")
+
+
+class EnsureTests:
+
+ # grinning face emoji
+ UNICODE_EMOJI = six.u("\U0001F600")
+ BINARY_EMOJI = b"\xf0\x9f\x98\x80"
+
+ def test_ensure_binary_raise_type_error(self):
+ with pytest.raises(TypeError):
+ six.ensure_str(8)
+
+ def test_errors_and_encoding(self):
+ six.ensure_binary(self.UNICODE_EMOJI, encoding='latin-1', errors='ignore')
+ with pytest.raises(UnicodeEncodeError):
+ six.ensure_binary(self.UNICODE_EMOJI, encoding='latin-1', errors='strict')
+
+ def test_ensure_binary_raise(self):
+ converted_unicode = six.ensure_binary(self.UNICODE_EMOJI, encoding='utf-8', errors='strict')
+ converted_binary = six.ensure_binary(self.BINARY_EMOJI, encoding="utf-8", errors='strict')
+ if six.PY2:
+ # PY2: unicode -> str
+ assert converted_unicode == self.BINARY_EMOJI and isinstance(converted_unicode, str)
+ # PY2: str -> str
+ assert converted_binary == self.BINARY_EMOJI and isinstance(converted_binary, str)
+ else:
+ # PY3: str -> bytes
+ assert converted_unicode == self.BINARY_EMOJI and isinstance(converted_unicode, bytes)
+ # PY3: bytes -> bytes
+ assert converted_binary == self.BINARY_EMOJI and isinstance(converted_binary, bytes)
+
+ def test_ensure_str(self):
+ converted_unicode = six.ensure_str(self.UNICODE_EMOJI, encoding='utf-8', errors='strict')
+ converted_binary = six.ensure_str(self.BINARY_EMOJI, encoding="utf-8", errors='strict')
+ if six.PY2:
+ # PY2: unicode -> str
+ assert converted_unicode == self.BINARY_EMOJI and isinstance(converted_unicode, str)
+ # PY2: str -> str
+ assert converted_binary == self.BINARY_EMOJI and isinstance(converted_binary, str)
+ else:
+ # PY3: str -> str
+ assert converted_unicode == self.UNICODE_EMOJI and isinstance(converted_unicode, str)
+ # PY3: bytes -> str
+ assert converted_binary == self.UNICODE_EMOJI and isinstance(converted_unicode, str)
+
+ def test_ensure_text(self):
+ converted_unicode = six.ensure_text(self.UNICODE_EMOJI, encoding='utf-8', errors='strict')
+ converted_binary = six.ensure_text(self.BINARY_EMOJI, encoding="utf-8", errors='strict')
+ if six.PY2:
+ # PY2: unicode -> unicode
+ assert converted_unicode == self.UNICODE_EMOJI and isinstance(converted_unicode, unicode)
+ # PY2: str -> unicode
+ assert converted_binary == self.UNICODE_EMOJI and isinstance(converted_unicode, unicode)
+ else:
+ # PY3: str -> str
+ assert converted_unicode == self.UNICODE_EMOJI and isinstance(converted_unicode, str)
+ # PY3: bytes -> str
+ assert converted_binary == self.UNICODE_EMOJI and isinstance(converted_unicode, str)