Skip to content

Commit fa62ec8

Browse files
authored
Update main.py
Add support for both Python2/Python3 rather than asking user to manually change the code as suggested in this comment: # If you can't use Python 3.x, please change "input" to "raw_input"
1 parent 364cd15 commit fa62ec8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drive/driveapp/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
import googleapiclient.http
1313
import oauth2client.client
1414

15+
#Add user input support for both Python2 and Python3
16+
try:
17+
input = raw_input # Python2
18+
except:
19+
pass # Python3
20+
1521
# OAuth 2.0 scope that will be authorized.
1622
# Check https://developers.google.com/drive/scopes for all available scopes.
1723
OAUTH2_SCOPE = 'https://www.googleapis.com/auth/drive'

0 commit comments

Comments
 (0)