Start packaging the bz2 python module as it is needed for building Qt5
[profile/ivi/python.git] / packaging / python-2.7.1-distutils_test_path.patch
1 Index: Python-2.7/Lib/distutils/tests/test_build_ext.py
2 ===================================================================
3 --- Python-2.7.orig/Lib/distutils/tests/test_build_ext.py
4 +++ Python-2.7/Lib/distutils/tests/test_build_ext.py
5 @@ -261,20 +261,14 @@ class BuildExtTestCase(support.TempdirMa
6  
7          # issue #5977 : distutils build_ext.get_outputs
8          # returns wrong result with --inplace
9 -        other_tmp_dir = os.path.realpath(self.mkdtemp())
10 -        old_wd = os.getcwd()
11 -        os.chdir(other_tmp_dir)
12 -        try:
13 -            cmd.inplace = 1
14 -            cmd.run()
15 -            so_file = cmd.get_outputs()[0]
16 -        finally:
17 -            os.chdir(old_wd)
18 +        cmd.inplace = 1
19 +        cmd.run()
20 +        so_file = cmd.get_outputs()[0]
21          self.assertTrue(os.path.exists(so_file))
22          self.assertEqual(os.path.splitext(so_file)[-1],
23                           sysconfig.get_config_var('SO'))
24          so_dir = os.path.dirname(so_file)
25 -        self.assertEqual(so_dir, other_tmp_dir)
26 +        self.assertEqual(so_dir, os.getcwd())
27          cmd.compiler = None
28          cmd.inplace = 0
29          cmd.run()
30 Index: Python-2.7/Lib/test/regrtest.py
31 ===================================================================
32 --- Python-2.7.orig/Lib/test/regrtest.py
33 +++ Python-2.7/Lib/test/regrtest.py
34 @@ -1503,16 +1503,5 @@ if __name__ == '__main__':
35          if not os.path.exists(TEMPDIR):
36              os.mkdir(TEMPDIR)
37  
38 -    # Define a writable temp dir that will be used as cwd while running
39 -    # the tests. The name of the dir includes the pid to allow parallel
40 -    # testing (see the -j option).
41 -    TESTCWD = 'test_python_{}'.format(os.getpid())
42 -
43 -    TESTCWD = os.path.join(TEMPDIR, TESTCWD)
44 -
45 -    # Run the tests in a context manager that temporary changes the CWD to a
46 -    # temporary and writable directory. If it's not possible to create or
47 -    # change the CWD, the original CWD will be used. The original CWD is
48 -    # available from test_support.SAVEDCWD.
49 -    with test_support.temp_cwd(TESTCWD, quiet=True):
50 -        main()
51 +    # do not change directory, because it breaks distutils tests
52 +    main()