Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further fix issue #4376 posix platform #4387

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions SCons/Platform/virtualenvTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# TODO: issue #4376: since Python 3.12, CPython's posixpath.py does a test
# import of 'posix', expecting it to fail on win32. However, if
# SCons/Platform is in sys.path, it will find our posix module instead.
# This happens in this unittest, since it's the script path. Remove
# it before the stdlib imports. Better way to handle this problem?
import sys
if 'Platform' in sys.path[0]:
platpath = sys.path.pop(0)
# pylint: disable=wrong-import-position
import collections
import unittest
import os
Expand All @@ -29,6 +38,7 @@
import SCons.compat
import SCons.Platform.virtualenv
import SCons.Util
# pylint: enable=wrong-import-position

class Environment(collections.UserDict):
def Detect(self, cmd):
Expand Down