Skip to content

Commit ff5813d

Browse files
author
Andrija Kolic
committed
Harden path check in cpyext helper by avoiding getsitepackages.
1 parent 8107d5a commit ff5813d

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -81,7 +81,7 @@ def get_setuptools(setuptools='setuptools==67.6.1'):
8181
print('setuptools is installed in %s' % setuptools_path)
8282

8383
pyvenv_site = str(setuptools_path)
84-
if pyvenv_site not in site.getsitepackages():
84+
if os.path.normcase(os.path.normpath(pyvenv_site)) not in {os.path.normcase(os.path.normpath(entry)) for entry in sys.path}:
8585
site.addsitedir(pyvenv_site)
8686

8787

0 commit comments

Comments
 (0)