Skip to content

Simplify and improve pywintypes search for dll in site-packages.#1933

Merged
mhammond merged 2 commits intomhammond:mainfrom
saaketp:pywintypes-venv-fix
Aug 22, 2022
Merged

Simplify and improve pywintypes search for dll in site-packages.#1933
mhammond merged 2 commits intomhammond:mainfrom
saaketp:pywintypes-venv-fix

Conversation

@saaketp
Copy link
Copy Markdown
Contributor

@saaketp saaketp commented Aug 19, 2022

Fixes #1932

The current method only looks at "global" and "user" site,
which is not enough if pywin32 is installed in "system" site packages
and imported from a venv created with --system-site-packages.

With this updated approach, we avoid looking at each site separately
and let the import statement find the location of pywin32_system32.

The current method only looks at "global" and "user" site,
which is not enough if pywin32 is installed in "system" site packages
and imported from a venv created with --system-site-packages.

With this updated approach, we avoid looking at each site separately
and let the import statement find the location of pywin32_system32.
Copy link
Copy Markdown
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks

@mhammond mhammond merged commit 50c3113 into mhammond:main Aug 22, 2022
@saaketp saaketp deleted the pywintypes-venv-fix branch August 22, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pywintypes.py cannot find pywintypes dll if imported from a venv created with --system-site-packages

2 participants