Commits

Jason R. Coombs committed fa82ba9

Select 'input' function based on Python version. Fixes #84

  • Participants
  • Parent commits 2462fe1

Comments (0)

Files changed (2)

keyring/backends/Google.py

 from keyring import errors
 from keyring import credentials
 import keyring.py25compat
+import keyring.py27compat
 from keyring.backend import KeyringBackend
 
 class EnvironCredential(credentials.EnvironCredential):
 
     def __init__(self, credential, source, crypter,
                  collection=None, client=None,
-                 can_create=True, input_getter=raw_input
+                 can_create=True, input_getter=keyring.py27compat.input
                 ):
         try:
             DocsService = (__import__('gdata.docs.service')

keyring/py27compat.py

     import configparser
 except ImportError:
     import ConfigParser as configparser
+
+if 'raw_input' in __builtins__:
+    input = raw_input
+else:
+    input = input