Skip to content

Commit

Permalink
Delete the password even if blank. Fixes #573.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 18, 2022
1 parent 22bcc9a commit aa2a9bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion keyring/backends/macOS/api.py
@@ -1,3 +1,4 @@
import contextlib
import ctypes
from ctypes import (
c_void_p,
Expand Down Expand Up @@ -147,7 +148,7 @@ def find_generic_password(kc_name, service, username, not_found_ok=False):


def set_generic_password(name, service, username, password):
if find_generic_password(name, service, username, not_found_ok=True):
with contextlib.suppress(NotFound):
delete_generic_password(name, service, username)

q = create_query(
Expand Down
1 change: 0 additions & 1 deletion keyring/testing/backend.py
Expand Up @@ -71,7 +71,6 @@ def test_password_set_get(self):
service = random_string(20)
self.check_set_get(service, username, password)

@pytest.mark.xfail(reason="#573")
def test_set_after_set_blank(self):
service = random_string(20)
username = random_string(20)
Expand Down

0 comments on commit aa2a9bd

Please sign in to comment.