[pypy-svn] pypy default: add lib-tk to the initial sys.path

antocuni commits-noreply at bitbucket.org
Tue Apr 19 10:03:56 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r43464:999cc606b472
Date: 2011-04-19 09:59 +0200
http://bitbucket.org/pypy/pypy/changeset/999cc606b472/

Log:	add lib-tk to the initial sys.path

diff --git a/pypy/module/sys/state.py b/pypy/module/sys/state.py
--- a/pypy/module/sys/state.py
+++ b/pypy/module/sys/state.py
@@ -54,6 +54,11 @@
     importlist.append(python_std_lib_modified)
     importlist.append(python_std_lib)
     #
+    lib_tk_modified = os.path.join(python_std_lib_modified, 'lib-tk')
+    lib_tk = os.path.join(python_std_lib, 'lib-tk')
+    importlist.append(lib_tk_modified)
+    importlist.append(lib_tk)
+    #
     # List here the extra platform-specific paths.
     if platform != 'win32':
         importlist.append(os.path.join(python_std_lib, 'plat-'+platform))

diff --git a/pypy/module/sys/test/test_initialpath.py b/pypy/module/sys/test/test_initialpath.py
--- a/pypy/module/sys/test/test_initialpath.py
+++ b/pypy/module/sys/test/test_initialpath.py
@@ -17,3 +17,12 @@
     path = getinitialpath(str(tmpdir))
     # we get at least 'dirs', and maybe more (e.g. plat-linux2)
     assert path[:len(dirs)] == map(str, dirs)
+
+def test_include_libtk(tmpdir):
+    lib_pypy, lib_python_modified, lib_python = build_hierarchy(tmpdir)
+    lib_tk_modified = lib_python_modified.join('lib-tk')
+    lib_tk = lib_python.join('lib-tk')
+    path = getinitialpath(str(tmpdir))
+    i = path.index(str(lib_tk_modified))
+    j = path.index(str(lib_tk))
+    assert i < j


More information about the Pypy-commit mailing list