Fixed path comparison in cases where symlinks to python executables are used. Signed-off-by: Sven Schrader Signed-off-by: Sven Rebhan Signed-off-by: Jochen Eppler --- distutils/command/build_ext.py 2009-05-20 14:02:07.039240200 +0200 +++ distutils/command/build_ext.py.new 2009-05-20 14:06:55.491335213 +0200 @@ -186,7 +186,7 @@ # for extensions under Cygwin and AtheOS Python's library directory must be # appended to library_dirs if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos': - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + if os.path.samefile(os.path.join(sys.exec_prefix, "bin"), os.path.dirname(sys.executable)): # building third party extensions self.library_dirs.append(os.path.join(sys.prefix, "lib", "python" + get_python_version(), @@ -199,7 +199,7 @@ # Python's library directory must be appended to library_dirs if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ and sysconfig.get_config_var('Py_ENABLE_SHARED'): - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + if os.path.samefile(os.path.join(sys.exec_prefix, "bin"), os.path.dirname(sys.executable)): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) else: