diff options
author | Rick Elrod <rick@elrod.me> | 2020-07-02 12:39:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 12:39:00 -0500 |
commit | 1be78dbfc5d6490806e2c421125bff675a4f7949 (patch) | |
tree | 1886a580418d4ae20ede8334b75edf8e72151965 /lib | |
parent | c600f8df58bcf19334bd281c1a92234311b8a876 (diff) | |
download | ansible-1be78dbfc5d6490806e2c421125bff675a4f7949.tar.gz |
Updated bundled libraries (#70418)
Change:
- Update bundled six to 1.13 (last with py2.6 support)
- Make it pass lint
- Fix check to allow skipping over compat __init__.py files we authored
- Fix check to allow files that can't be updated for some reason
Test Plan:
- ansible-test sanity --docker
- CI
Signed-off-by: Rick Elrod <rick@elrod.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/compat/selectors/__init__.py | 2 | ||||
-rw-r--r-- | lib/ansible/module_utils/six/__init__.py | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/ansible/compat/selectors/__init__.py b/lib/ansible/compat/selectors/__init__.py index 6bbf6d8b57..a7b260e348 100644 --- a/lib/ansible/compat/selectors/__init__.py +++ b/lib/ansible/compat/selectors/__init__.py @@ -19,6 +19,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +# NOT_BUNDLED + ''' Compat selectors library. Python-3.5 has this builtin. The selectors2 package exists on pypi to backport the functionality as far as python-2.6. diff --git a/lib/ansible/module_utils/six/__init__.py b/lib/ansible/module_utils/six/__init__.py index d2d9a45af6..9df35d54b0 100644 --- a/lib/ansible/module_utils/six/__init__.py +++ b/lib/ansible/module_utils/six/__init__.py @@ -3,7 +3,7 @@ # upstream vendored file that we're not going to modify on our own # pylint: disable=undefined-variable -# Copyright (c) 2010-2018 Benjamin Peterson +# Copyright (c) 2010-2019 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 @@ -35,10 +35,11 @@ import types # The following makes it easier for us to script updates of the bundled code. It is not part of # upstream six -_BUNDLED_METADATA = {"pypi_name": "six", "version": "1.12.0"} +# CANT_UPDATE due to py2.6 drop: https://github.com/benjaminp/six/pull/314 +_BUNDLED_METADATA = {"pypi_name": "six", "version": "1.13.0"} __author__ = "Benjamin Peterson <benjamin@python.org>" -__version__ = "1.12.0" +__version__ = "1.13.0" # Useful for very coarse version differentiation. @@ -265,8 +266,10 @@ _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("dbm_ndbm", "dbm", "dbm.ndbm"), MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), MovedModule("http_cookies", "Cookie", "http.cookies"), @@ -648,6 +651,7 @@ if PY3: import io StringIO = io.StringIO BytesIO = io.BytesIO + del io _assertCountEqual = "assertCountEqual" if sys.version_info[1] <= 1: _assertRaisesRegex = "assertRaisesRegexp" @@ -835,7 +839,15 @@ def with_metaclass(meta, *bases): 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): |