From 997eae8020dc28ea1ef87572275f5dc41e1bc74a Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sun, 4 Oct 2020 16:11:27 +0100 Subject: ignore any exception when loading 2to3 --- setuptools/command/build_py.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py index 4709679b..b30aa129 100644 --- a/setuptools/command/build_py.py +++ b/setuptools/command/build_py.py @@ -11,7 +11,7 @@ import stat try: from setuptools.lib2to3_ex import Mixin2to3 -except ImportError: +except Exception: class Mixin2to3: def run_2to3(self, files, doctests=True): -- cgit v1.2.1 From f67c1b099d24a37a0c65bf08f88cb46e261d2a61 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Oct 2020 20:03:04 -0400 Subject: Extract method for maybe_tag. --- setuptools/command/egg_info.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'setuptools/command') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index c957154a..0b7ad677 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -123,12 +123,17 @@ class InfoCommon: return safe_name(self.distribution.get_name()) def tagged_version(self): - version = self.distribution.get_version() - # egg_info may be called more than once for a distribution, - # in which case the version string already contains all tags. - if self.vtags and version.endswith(self.vtags): - return safe_version(version) - return safe_version(version + self.vtags) + return safe_version(self._maybe_tag(self.distribution.get_version())) + + def _maybe_tag(self, version): + """ + egg_info may be called more than once for a distribution, + in which case the version string already contains all tags. + """ + return ( + version if self.vtags and version.endswith(self.vtags) + else version + self.vtags + ) def tags(self): version = '' -- cgit v1.2.1