1. Benji York
  2. python-keyring-lib

Commits

Benji York  committed 8e8b55e

fix KWallet code

  • Participants
  • Parent commits 896f794
  • Branches default

Comments (0)

Files changed (1)

File keyring/backend.py

View file
     def get_password(self, service, username):
         """Get password of the username for the service
         """
-        result = kwallet.readPassword(username+'@'+service)[1]
-        # An empty string signifies that the token does not exist.
-        if result == '':
+        key = username + '@' + service
+        network = KWallet.Wallet.NetworkWallet()
+        if kwallet.keyDoesNotExist(network, 'Python', key):
             return None
+
+        result = kwallet.readPassword(key)[1]
         # The string will be a PyQt4.QtCore.QString, so turn it into a unicode
         # object.
         return unicode(result)