Merged update from upstream sources
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/scons.git#68473e6f5cb50fff956f262ccccb043912b3d9c3
This commit is contained in:
parent
b3914319f9
commit
0ea4a33554
|
@ -26,3 +26,4 @@
|
|||
/scons-doc-4.0.0.tar.gz
|
||||
/scons-4.0.1.tar.gz
|
||||
/scons-doc-4.0.1.tar.gz
|
||||
/scons-4.1.0.tar.gz
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
From d3c6a4a199beff6e4d28725da9c0b0a052349359 Mon Sep 17 00:00:00 2001
|
||||
From: Mats Wichmann <mats@linux.com>
|
||||
Date: Tue, 12 Jan 2021 07:48:33 -0700
|
||||
Subject: [PATCH] Work around Py3.10 optimizing out a builder test
|
||||
|
||||
BuilderBase class traps __bool__ call and raises InternalError.
|
||||
On Py 3.10a the unit test for this got optimized out, avoid this.
|
||||
|
||||
While we're at it, eliminate remaining references to __nonzero__,
|
||||
which was a Py2-ism, replaced by __bool__.
|
||||
|
||||
Closes #3860
|
||||
|
||||
Signed-off-by: Mats Wichmann <mats@linux.com>
|
||||
---
|
||||
SCons/Builder.py | 5 +----
|
||||
SCons/BuilderTests.py | 17 ++++++++++++-----
|
||||
SCons/Environment.py | 2 +-
|
||||
SCons/Node/__init__.py | 2 +-
|
||||
SCons/Util.py | 7 +------
|
||||
6 files changed, 18 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/SCons/Builder.py b/SCons/Builder.py
|
||||
index a0df27203..4c2ad7fad 100644
|
||||
--- a/SCons/Builder.py
|
||||
+++ b/SCons/Builder.py
|
||||
@@ -430,11 +430,8 @@ def __init__(self, action = None,
|
||||
src_builder = [ src_builder ]
|
||||
self.src_builder = src_builder
|
||||
|
||||
- def __nonzero__(self):
|
||||
- raise InternalError("Do not test for the Node.builder attribute directly; use Node.has_builder() instead")
|
||||
-
|
||||
def __bool__(self):
|
||||
- return self.__nonzero__()
|
||||
+ raise InternalError("Do not test for the Node.builder attribute directly; use Node.has_builder() instead")
|
||||
|
||||
def get_name(self, env):
|
||||
"""Attempts to get the name of the Builder.
|
||||
diff --git a/SCons/BuilderTests.py b/SCons/BuilderTests.py
|
||||
index 0e46194f2..8d616f131 100644
|
||||
--- a/SCons/BuilderTests.py
|
||||
+++ b/SCons/BuilderTests.py
|
||||
@@ -207,13 +207,14 @@ def test__init__(self):
|
||||
x = builder.overrides['OVERRIDE']
|
||||
assert x == 'x', x
|
||||
|
||||
- def test__nonzero__(self):
|
||||
- """Test a builder raising an exception when __nonzero__ is called
|
||||
- """
|
||||
+ def test__bool__(self):
|
||||
+ """Test a builder raising an exception when __bool__ is called. """
|
||||
+
|
||||
+ # basic test: explicitly call it
|
||||
builder = SCons.Builder.Builder(action="foo")
|
||||
exc_caught = None
|
||||
try:
|
||||
- builder.__nonzero__()
|
||||
+ builder.__bool__()
|
||||
except SCons.Errors.InternalError:
|
||||
exc_caught = 1
|
||||
assert exc_caught, "did not catch expected InternalError exception"
|
||||
@@ -221,12 +222,18 @@ def test__nonzero__(self):
|
||||
class Node:
|
||||
pass
|
||||
|
||||
+ # the interesting test: checking the attribute this way
|
||||
+ # should call back to Builder.__bool__ - so we can tell
|
||||
+ # people not to check that way (for performance).
|
||||
+ # TODO: workaround #3860: with just a "pass" in the check body,
|
||||
+ # py3.10a optimizes out the whole thing, so add a "real" stmt
|
||||
n = Node()
|
||||
n.builder = builder
|
||||
exc_caught = None
|
||||
try:
|
||||
if n.builder:
|
||||
- pass
|
||||
+ #pass
|
||||
+ _ = True
|
||||
except SCons.Errors.InternalError:
|
||||
exc_caught = 1
|
||||
assert exc_caught, "did not catch expected InternalError exception"
|
||||
diff --git a/SCons/Environment.py b/SCons/Environment.py
|
||||
index 0b8a20adc..61128af36 100644
|
||||
--- a/SCons/Environment.py
|
||||
+++ b/SCons/Environment.py
|
||||
@@ -1538,7 +1538,7 @@ def Detect(self, progs):
|
||||
|
||||
|
||||
def Dictionary(self, *args):
|
||||
- """Return construction variables from an environment.
|
||||
+ r"""Return construction variables from an environment.
|
||||
|
||||
Args:
|
||||
\*args (optional): variable names to look up
|
||||
diff --git a/SCons/Node/__init__.py b/SCons/Node/__init__.py
|
||||
index 3685af300..491c6b8c5 100644
|
||||
--- a/SCons/Node/__init__.py
|
||||
+++ b/SCons/Node/__init__.py
|
||||
@@ -886,7 +886,7 @@ def has_builder(self):
|
||||
than simply examining the builder attribute directly ("if
|
||||
node.builder: ..."). When the builder attribute is examined
|
||||
directly, it ends up calling __getattr__ for both the __len__
|
||||
- and __nonzero__ attributes on instances of our Builder Proxy
|
||||
+ and __bool__ attributes on instances of our Builder Proxy
|
||||
class(es), generating a bazillion extra calls and slowing
|
||||
things down immensely.
|
||||
"""
|
||||
diff --git a/SCons/Util.py b/SCons/Util.py
|
||||
index fae2d64fe..0f26fb134 100644
|
||||
--- a/SCons/Util.py
|
||||
+++ b/SCons/Util.py
|
||||
@@ -125,11 +125,8 @@ class NodeList(UserList):
|
||||
# self.data = [ initlist,]
|
||||
|
||||
|
||||
- def __nonzero__(self):
|
||||
- return len(self.data) != 0
|
||||
-
|
||||
def __bool__(self):
|
||||
- return self.__nonzero__()
|
||||
+ return len(self.data) != 0
|
||||
|
||||
def __str__(self):
|
||||
return ' '.join(map(str, self.data))
|
||||
@@ -1563,8 +1560,6 @@ def __call__(self, *args, **kwargs):
|
||||
return self
|
||||
def __repr__(self):
|
||||
return "Null(0x%08X)" % id(self)
|
||||
- def __nonzero__(self):
|
||||
- return False
|
||||
def __bool__(self):
|
||||
return False
|
||||
def __getattr__(self, name):
|
25
scons.spec
25
scons.spec
|
@ -7,23 +7,23 @@
|
|||
%bcond_without doc
|
||||
|
||||
# Install prebuilt documentation
|
||||
%bcond_without prebuilt_doc
|
||||
%bcond_with prebuilt_doc
|
||||
|
||||
# Additional EPEL7 builds
|
||||
%bcond_with python3_other
|
||||
|
||||
Name: scons
|
||||
Version: 4.0.1
|
||||
Release: 4%{?dist}
|
||||
Version: 4.1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: An Open Source software construction tool
|
||||
License: MIT
|
||||
URL: http://www.scons.org
|
||||
Source0: https://github.com/SCons/scons/archive/%{version}/scons-%{version}.tar.gz
|
||||
Source1: https://scons.org/doc/production/scons-doc-%{version}.tar.gz
|
||||
%if %{with prebuilt_doc}
|
||||
Source1: https://scons.org/doc/production/scons-doc-%%{version}.tar.gz
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
|
||||
Patch0: %{name}-%{version}-bug3860.patch
|
||||
|
||||
%description
|
||||
SCons is an Open Source software construction tool--that is, a build
|
||||
tool; an improved substitute for the classic Make utility; a better way
|
||||
|
@ -117,14 +117,10 @@ defined Builder and/or Scanner objects.
|
|||
%setup -n %{name}-%{version} -q -T -D -a 1
|
||||
cd ..
|
||||
%else
|
||||
%autosetup -T -b 0
|
||||
%autosetup -N -T -b 0
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
pushd %{name}-%{version}
|
||||
%autopatch -p1
|
||||
popd
|
||||
|
||||
# Convert to UTF-8
|
||||
for file in %{name}-%{version}/src/*.txt; do
|
||||
iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
|
||||
|
@ -166,6 +162,7 @@ rm -rfv %{buildroot}%{_bindir}/__pycache__
|
|||
# Install manpages
|
||||
mkdir -p %{buildroot}%{_mandir}/man1
|
||||
install -pm 644 build/doc/man/*.1 %{buildroot}%{_mandir}/man1/
|
||||
rm -f %{buildroot}%{_datadir}/*.1
|
||||
|
||||
pushd %{buildroot}%{_bindir}
|
||||
for i in %{name}-3 %{name}-v%{version}-%{python3_version} %{name}-%{python3_version}; do
|
||||
|
@ -247,6 +244,12 @@ popd
|
|||
%license LICENSE*
|
||||
|
||||
%changelog
|
||||
* Thu Jan 28 2021 Antonio Trande <sagitter@fedoraproject.org> - 4.1.0-1
|
||||
- Release 4.1.0
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jan 13 2021 Antonio Trande <sagitter@fedoraproject.org> - 4.0.1-4
|
||||
- Patched for Python-310 (rhbz#1914318)
|
||||
|
||||
|
|
3
sources
3
sources
|
@ -1,2 +1 @@
|
|||
SHA512 (scons-4.0.1.tar.gz) = f23c5dfd3c236e9f9f85b986ca64a36dbd85e9f3383cb3577e082a7dea4b83283020fbf064c2d919ab116195c6708fc11f906fcf3b0bc0533a4bc49a4f7371c6
|
||||
SHA512 (scons-doc-4.0.1.tar.gz) = f544e6e6af2095dd7c57b6eadcd06ece14b73117d33dc887674d588e87dd230f701ae130b89e0a8d0a450c5b006b8f02a0402d53dadb25284e5e244e3a47b36c
|
||||
SHA512 (scons-4.1.0.tar.gz) = f79b86bb09783767b3872cfb8efb665372714a604af2aaf3adc66eee63d3afe27bc6b2aab83813743c83f71c81c800d42842e916501787ba402ce2726dda9b44
|
||||
|
|
Loading…
Reference in New Issue