8000 gh-78997: AttributeError if loading fails in LibraryLoader.__getattr__ by farfella · Pull Request #25177 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-78997: AttributeError if loading fails in LibraryLoader.__getattr__ #25177

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

Merged
merged 7 commits into from
Dec 15, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
merging in 3.11 updates
  • Loading branch information
farfella committed Dec 15, 2022
commit b8aaba9126ce84e4371f49d644743213d798ba9f
8 changes: 5 additions & 3 deletions Lib/ctypes/test/test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import sys
import unittest
import test.support
from test.support import import_helper
from test.support import os_helper
from ctypes.util import find_library

libc_name = None
Expand Down Expand Up @@ -91,7 +93,7 @@ def test_1703286_A(self):
# NOT fit into a 32-bit integer. FreeLibrary must be able
# to accept this address.

# These are tests for http://www.python.org/sf/1703286
# These are tests for https://www.python.org/sf/1703286
handle = LoadLibrary("advapi32")
FreeLibrary(handle)

Expand Down Expand Up @@ -123,14 +125,14 @@ def test_load_hasattr(self):
@unittest.skipUnless(os.name == "nt",
'test specific to Windows')
def test_load_dll_with_flags(self):
_sqlite3 = test.support.import_module("_sqlite3")
_sqlite3 = import_helper.import_module("_sqlite3")
src = _sqlite3.__file__
if src.lower().endswith("_d.pyd"):
ext = "_d.dll"
else:
ext = ".dll"

with test.support.temp_dir() as tmp:
with os_helper.temp_dir() as tmp:
# We copy two files and load _sqlite3.dll (formerly .pyd),
# which has a dependency on sqlite3.dll. Then we test
# loading it in subprocesses to avoid it starting in memory
Expand Down
0