Skip to content

Commit

Permalink
refactor: remove value_or_empty which is no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
twiggler committed Jan 7, 2025
1 parent fe2dd33 commit 375faea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion dissect/target/helpers/regutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
KeyType = Union[regf.IndexLeaf, regf.FastLeaf, regf.HashLeaf, regf.IndexRoot, regf.NamedKey]
"""The possible key types that can be returned from the registry."""

ValueType = Union[int, str, bytes, list[str], None]
ValueType = Union[int, str, bytes, list[str]]
"""The possible value types that can be returned from the registry."""


Expand Down
12 changes: 0 additions & 12 deletions dissect/target/plugins/os/windows/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from dissect.target.exceptions import (
HiveUnavailableError,
RegistryError,
RegistryKeyNotFoundError,
RegistryValueNotFoundError,
UnsupportedPluginError,
Expand Down Expand Up @@ -292,17 +291,6 @@ def value(self, key: str, value: str) -> ValueCollection:
"""Convenience method for accessing a specific value."""
return self.key(key).value(value)

@internal
def value_or_empty(self, key: str, value: str) -> ValueCollection:
"""Convenience method for trying to access a specific value.
Returns a empty collection if the key or value does not exist.
"""
try:
return self.value(key, value)
except RegistryError:
return ValueCollection()

@internal
def subkey(self, key: str, subkey: str) -> KeyCollection:
"""Convenience method for accessing a specific subkey."""
Expand Down

0 comments on commit 375faea

Please sign in to comment.