scons/removed_splitunc.patch
Tomáš Chvátal 7d5d49b536 Accepting request 640640 from home:mcepl:work
- Make package not to be noarch (bsc#1109755)
- Make package multibuild for separate testing
- Block failing tests (and block %check section completely on
  non-Intel archs, as the tests are apparently not designed for
  that).
- Fix patches from the upstream to improve compatbiilty:
    fix-jN-for-python-37.patch
    fix-rpm-tests-for-newer-rpmbuild.patch
    no_deprecated_asserts.patch
    no_time-clock.patch
    removed_splitunc.patch
    replace_TestSuite_main.patch
    stop_custom_OrderedDict.patch
- Remove replace-imp-with-importlib.patch for now (to stabilize
  the package first)

OBS-URL: https://build.opensuse.org/request/show/640640
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=64
2018-10-08 19:36:14 +00:00

40 lines
1.5 KiB
Diff

--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -132,7 +132,10 @@ def initialize_do_splitdrive():
global do_splitdrive
global has_unc
drive, path = os.path.splitdrive('X:/foo')
- has_unc = hasattr(os.path, 'splitunc')
+ # splitunc is removed from python 3.7 and newer
+ # so we can also just test if splitdrive works with UNC
+ has_unc = (hasattr(os.path, 'splitunc')
+ or os.path.splitdrive(r'\\split\drive\test')[0] == r'\\split\drive')
do_splitdrive = not not drive or has_unc
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -605,7 +605,7 @@ class VariantDirTestCase(unittest.TestCa
print("File `%s' alter_targets() `%s' != expected `%s'" % (f, tp, expect))
errors = errors + 1
- self.failIf(errors)
+ self.assertFalse(errors)
class BaseTestCase(_tempdirTestCase):
def test_stat(self):
@@ -1657,7 +1657,12 @@ class FSTestCase(_tempdirTestCase):
import ntpath
x = test.workpath(*dirs)
drive, path = ntpath.splitdrive(x)
- unc, path = ntpath.splitunc(path)
+ try:
+ unc, path = ntpath.splitunc(path)
+ except AttributeError:
+ # could be python 3.7 or newer, make sure splitdrive can do UNC
+ assert ntpath.splitdrive(r'\\split\drive\test')[0] == r'\\split\drive'
+ pass
path = strip_slash(path)
return '//' + path[1:]