summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-04-22 16:04:46 (GMT)
committerGitHub <noreply@github.com>2020-04-22 16:04:46 (GMT)
commit9b498939009f49b8c772c89e8fc80efbfd8afcb5 (patch)
tree278d8e0d4655241305d7b226eec68aef502f42f2
parent9bee32b34e4fb3e67a88bf14d38153851d4c4598 (diff)
downloadcpython-9b498939009f49b8c772c89e8fc80efbfd8afcb5.zip
cpython-9b498939009f49b8c772c89e8fc80efbfd8afcb5.tar.gz
cpython-9b498939009f49b8c772c89e8fc80efbfd8afcb5.tar.bz2
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
-rw-r--r--Lib/ctypes/test/test_loading.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py
index a62044e..5c48b0d 100644
--- a/Lib/ctypes/test/test_loading.py
+++ b/Lib/ctypes/test/test_loading.py
@@ -158,11 +158,9 @@ class LoaderTest(unittest.TestCase):
# Relative path (but not just filename) should succeed
should_pass("WinDLL('./_sqlite3.dll')")
- # XXX: This test has started failing on Azure Pipelines CI. See
- # bpo-40214 for more information.
- if 0:
- # Insecure load flags should succeed
- should_pass("WinDLL('_sqlite3.dll', winmode=0)")
+ # Insecure load flags should succeed
+ # Clear the DLL directory to avoid safe search settings propagating
+ should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)")
# Full path load without DLL_LOAD_DIR shouldn't find dependency
should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +