Skip to content

Commit

Permalink
Improve the HKCR declarations.
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Jan 14, 2025
1 parent 6958f87 commit aea8024
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions comtypes/server/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ def _get_pythonpath(cls: Type) -> str:
return os.path.abspath(dirname)


def _iter_reg_entries(cls: Type, reg_clsid: str) -> Iterator[_Entry]:
HKCR = winreg.HKEY_CLASSES_ROOT
HKCR = winreg.HKEY_CLASSES_ROOT

# basic entry - names the comobject

def _iter_reg_entries(cls: Type, reg_clsid: str) -> Iterator[_Entry]:
# basic entry - names the comobject
reg_desc = getattr(cls, "_reg_desc_", "")
if not reg_desc:
# Simple minded algorithm to construct a description from
Expand Down Expand Up @@ -353,8 +353,6 @@ def _iter_reg_entries(cls: Type, reg_clsid: str) -> Iterator[_Entry]:
def _iter_ctx_entries(
cls: Type, reg_clsid: str, frozen: Optional[str], frozendllhandle: Optional[int]
) -> Iterator[_Entry]:
HKCR = winreg.HKEY_CLASSES_ROOT

clsctx: int = getattr(cls, "_reg_clsctx_", 0)
localsvr_ctx = bool(clsctx & CLSCTX_LOCAL_SERVER)
inprocsvr_ctx = bool(clsctx & CLSCTX_INPROC_SERVER)
Expand Down

0 comments on commit aea8024

Please sign in to comment.