From: DongHun Kwak Date: Mon, 18 Jul 2022 07:22:52 +0000 (+0900) Subject: Imported Upstream version 1.16.0 X-Git-Tag: upstream/1.16.0^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23789bb5883f36e171c685bdc16691ad5650094f;p=platform%2Fupstream%2Fpython3-six.git Imported Upstream version 1.16.0 --- diff --git a/CHANGES b/CHANGES index ad4cbaa..f3bf6a4 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,12 @@ 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 ------ @@ -100,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 @@ -227,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/PKG-INFO b/PKG-INFO index 75aba67..1e57620 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: six -Version: 1.15.0 +Version: 1.16.0 Summary: Python 2 and 3 compatibility utilities Home-page: https://github.com/benjaminp/six Author: Benjamin Peterson diff --git a/six.egg-info/PKG-INFO b/six.egg-info/PKG-INFO index 75aba67..1e57620 100644 --- a/six.egg-info/PKG-INFO +++ b/six.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: six -Version: 1.15.0 +Version: 1.16.0 Summary: Python 2 and 3 compatibility utilities Home-page: https://github.com/benjaminp/six Author: Benjamin Peterson diff --git a/six.py b/six.py index 83f6978..4e15675 100644 --- a/six.py +++ b/six.py @@ -29,7 +29,7 @@ import sys import types __author__ = "Benjamin Peterson " -__version__ = "1.15.0" +__version__ = "1.16.0" # Useful for very coarse version differentiation. @@ -71,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.""" @@ -186,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] @@ -223,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__)