From 176cda11dffa7759dae138b49f103e6411e6679e Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Mon, 22 Mar 2010 22:52:11 +0000 Subject: [PATCH] Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only). --- Lib/site.py | 2 +- Misc/NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/site.py b/Lib/site.py index e391670ed4..b36df1f5dc 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -118,7 +118,7 @@ def addbuilddir(): s = "build/lib.%s-%.3s" % (get_platform(), sys.version) if hasattr(sys, 'gettotalrefcount'): s += '-pydebug' - s = os.path.join(os.path.dirname(sys.path[-1]), s) + s = os.path.join(os.path.dirname(sys.path.pop()), s) sys.path.append(s) diff --git a/Misc/NEWS b/Misc/NEWS index f05e90ef1e..7395196495 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -29,6 +29,9 @@ Core and Builtins Library ------- +- Issue #8205: Remove the "Modules" directory from sys.path when Python is + running from the build directory (POSIX only). + - Issue #7667: Fix doctest failures with non-ASCII paths. - Issue #7512: shutil.copystat() could raise an OSError when the filesystem -- 2.50.0