diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-02-02 22:54:28 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-02-02 22:54:28 (GMT) |
commit | e81b0289b68bbb0bd19e5a17b845a808a1b9f252 (patch) | |
tree | a1ab4d80d5bfc577a2e51e37a997d03b1ae8496b /Lib | |
parent | cc118178083c99bea93cae9551e0e74bdc505d1d (diff) | |
download | cpython-e81b0289b68bbb0bd19e5a17b845a808a1b9f252.zip cpython-e81b0289b68bbb0bd19e5a17b845a808a1b9f252.tar.gz cpython-e81b0289b68bbb0bd19e5a17b845a808a1b9f252.tar.bz2 |
sysconfig.get_scheme_names now returns a sorted tuple
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sysconfig.py | 4 | ||||
-rw-r--r-- | Lib/test/test_sysconfig.py | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 1d35082..0c13bba 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -343,7 +343,9 @@ def get_config_h_filename(): def get_scheme_names(): """Returns a tuple containing the schemes names.""" - return _INSTALL_SCHEMES.keys() + schemes = _INSTALL_SCHEMES.keys() + schemes.sort() + return tuple(schemes) def get_path_names(): """Returns a tuple containing the paths names.""" diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index efbfe97..0fd0910 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -15,7 +15,8 @@ from test.test_support import run_unittest, TESTFN import sysconfig from sysconfig import (get_paths, get_platform, get_config_vars, get_path, get_path_names, _INSTALL_SCHEMES, - _get_default_scheme, _expand_vars) + _get_default_scheme, _expand_vars, + get_scheme_names) class TestSysConfig(unittest.TestCase): @@ -232,6 +233,11 @@ class TestSysConfig(unittest.TestCase): config_h = sysconfig.get_config_h_filename() self.assertTrue(os.path.isfile(config_h), config_h) + def test_get_scheme_names(self): + wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'posix_home', + 'posix_prefix', 'posix_user') + self.assertEquals(get_scheme_names(), wanted) + def test_main(): run_unittest(TestSysConfig) |