Skip to content

Commit

Permalink
Fix regression in winreg lookup (#110)
Browse files Browse the repository at this point in the history
* Fix regression in winreg lookup

* Update version
  • Loading branch information
melund authored Feb 8, 2024
1 parent 98977e5 commit 146a896
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# AnyPyTools Change Log

## v1.11.4

**Fixed:**

* Fix regression in windows registry lookup which caused AnyPyTools to crash.


## v1.11.3

**Added:**
Expand Down
2 changes: 1 addition & 1 deletion anypytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"NORMAL_PRIORITY_CLASS",
]

__version__ = "1.11.3"
__version__ = "1.11.4"


def print_versions():
Expand Down
4 changes: 2 additions & 2 deletions anypytools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ def lookup_anybody_in_registry() -> str | None:
]
for key in keys_to_try:
try:
value = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, key)
except WindowsError:
value = winreg.QueryValue(winreg.HKEY_CLASSES_ROOT, key)
except OSError:
continue
anybodypath = value.rsplit(" ", 1)[0].strip('"')
return os.path.join(os.path.dirname(anybodypath), "AnyBodyCon.exe")
Expand Down

0 comments on commit 146a896

Please sign in to comment.