[Python-checkins] r77921 - in python/trunk/Lib: sysconfig.py test/test_sysconfig.py

tarek.ziade python-checkins at python.org
Tue Feb 2 23:54:28 CET 2010


Author: tarek.ziade
Date: Tue Feb  2 23:54:28 2010
New Revision: 77921

Log:
sysconfig.get_scheme_names now returns a sorted tuple

Modified:
   python/trunk/Lib/sysconfig.py
   python/trunk/Lib/test/test_sysconfig.py

Modified: python/trunk/Lib/sysconfig.py
==============================================================================
--- python/trunk/Lib/sysconfig.py	(original)
+++ python/trunk/Lib/sysconfig.py	Tue Feb  2 23:54:28 2010
@@ -343,7 +343,9 @@
 
 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."""

Modified: python/trunk/Lib/test/test_sysconfig.py
==============================================================================
--- python/trunk/Lib/test/test_sysconfig.py	(original)
+++ python/trunk/Lib/test/test_sysconfig.py	Tue Feb  2 23:54:28 2010
@@ -15,7 +15,8 @@
 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 @@
         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)


More information about the Python-checkins mailing list