1. Robert Leftwich
  2. Python Keyring Lib PyFilesystem and Google Docs

Commits

Robert Leftwich  committed 96e3846 Merge

Merge osx-keychain-communicate into pyfs_gdocs_backend

  • Participants
  • Parent commits 1c3efc0, 4d591d3
  • Branches pyfs_gdocs_backend

Comments (0)

Files changed (2)

File keyring/backend.py

View file
             self.win32cred = None
 
     def supported(self):
-        '''Default Windows backend, when it is available
-        '''
+        """Default Windows backend, when it is available
+        """
         recommended = select_windows_backend()
         if recommended == None:
             return -1

File keyring/backends/osx_keychain.py

View file
             stderr = subprocess.PIPE,
             stdout = subprocess.PIPE,
         )
-        code = call.wait()
+        stdoutdata, stderrdata = call.communicate()
+        code = call.returncode
         # check return code.
         if code is not 0:
             raise OSError('Can\'t store password in keychain')
             stderr = subprocess.PIPE,
             stdout = subprocess.PIPE,
         )
-        code = call.wait()
+        stdoutdata, stderrdata = call.communicate()
+        code = call.returncode
         if code is not 0:
             raise OSError("Can't fetch password from system")
-        output = call.stderr.readlines()[0]
+        output = stderrdata
         # check for empty password.
         if output == 'password: \n':
             return ''