Commits

Antonio Cuni committed 999cc60

add lib-tk to the initial sys.path

Comments (0)

Files changed (2)

pypy/module/sys/state.py

     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))

pypy/module/sys/test/test_initialpath.py

     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