Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:

- name: Install packages
run: pdm install
- name: Run Pre-Commit Tests
uses: pre-commit/action@v3.0.0
- name: Run Integration
run: pdm run findpython --all -v
- name: Run Tests
Expand Down
19 changes: 14 additions & 5 deletions src/findpython/pep514tools/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,27 @@
"REGISTRY_SOURCE_CU",
]

import sys
import re
from itertools import count

try:
import winreg
except ImportError:
import _winreg as winreg

REGISTRY_SOURCE_LM = 1
REGISTRY_SOURCE_LM_WOW6432 = 2
REGISTRY_SOURCE_CU = 3

# Simple tests direcly on sys variables are necessary to please mypy
if sys.platform == "win32":
if sys.version_info >= (3,):
import winreg
else:
import _winreg as winreg
else:
def open_source():
pass

# Prevents mypy (and python) from parsing further on non-win32 platforms
assert sys.platform == "win32"

_REG_KEY_INFO = {
REGISTRY_SOURCE_LM: (
winreg.HKEY_LOCAL_MACHINE,
Expand Down