Accepting request 539227 from home:pluskalm:python3
- Add scons-fix_py3_syspath_explosion.patch OBS-URL: https://build.opensuse.org/request/show/539227 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=51
This commit is contained in:
parent
1a0a443ae6
commit
37db095af1
40
scons-fix_py3_syspath_explosion.patch
Normal file
40
scons-fix_py3_syspath_explosion.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 874dba0c35cd8f6459ddbdfcdaf8be12307cd038 Mon Sep 17 00:00:00 2001
|
||||
From: William Deegan <bill@baddogconsulting.com>
|
||||
Date: Thu, 12 Oct 2017 23:13:49 -0400
|
||||
Subject: [PATCH] Fix issue with Tool loading logic where sys.path was getting
|
||||
an addition site_scons/site_tools path prepended with every tool loaded when
|
||||
running with Python 3.5+.
|
||||
|
||||
---
|
||||
src/engine/SCons/Tool/__init__.py | 10 ++++++++--
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
|
||||
index 57090bbe..a4e44a0f 100644
|
||||
--- a/src/engine/SCons/Tool/__init__.py
|
||||
+++ b/src/engine/SCons/Tool/__init__.py
|
||||
@@ -222,8 +222,10 @@ def _tool_module(self):
|
||||
|
||||
# Don't reload a tool we already loaded.
|
||||
sys_modules_value = sys.modules.get(found_name,False)
|
||||
+
|
||||
+ found_module = None
|
||||
if sys_modules_value and sys_modules_value.__file__ == spec.origin:
|
||||
- return sys.modules[found_name]
|
||||
+ found_module = sys.modules[found_name]
|
||||
else:
|
||||
# Not sure what to do in the case that there already
|
||||
# exists sys.modules[self.name] but the source file is
|
||||
@@ -235,7 +237,11 @@ def _tool_module(self):
|
||||
# If we found it in SCons.Tool, then add it to the module
|
||||
setattr(SCons.Tool, self.name, module)
|
||||
|
||||
- return module
|
||||
+ found_module = module
|
||||
+
|
||||
+ if found_module is not None:
|
||||
+ sys.path = oldpythonpath
|
||||
+ return found_module
|
||||
|
||||
|
||||
sys.path = oldpythonpath
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 6 08:40:54 UTC 2017 - mpluskal@suse.com
|
||||
|
||||
- Add scons-fix_py3_syspath_explosion.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com
|
||||
|
||||
|
@ -29,6 +29,8 @@ Source1: scons-user.html-%{version}.tar.bz2
|
||||
# Sets _mandir to _datadir/man instead of _prefix/man
|
||||
Patch0: %{name}-3.0.0-fix-install.patch
|
||||
Patch1: scons-3.0.0-support-python-2-prints.patch
|
||||
# PATCH-FIX-UPSTREAM scons-fix_py3_syspath_explosion.patch
|
||||
Patch2: scons-fix_py3_syspath_explosion.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python3-devel >= 3.5
|
||||
BuildArch: noarch
|
||||
@ -44,6 +46,7 @@ full power of Python to control compilation.
|
||||
%setup -q -a1
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p2
|
||||
|
||||
# fix libdir for qt
|
||||
patch -p0 <<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user