Skip to content

Commit 93632eb

Browse files
committed
examples/apikey: make it work on python3
1 parent b95a6b6 commit 93632eb

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

examples/apikey.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@
99
# create.py: Create a new bug report
1010

1111
from __future__ import print_function
12+
import sys
1213

1314
import bugzilla
1415

1516
# Don't worry, changing things here is fine, and won't send any email to
1617
# users or anything. It's what landfill.bugzilla.org is for!
1718
URL = "https://landfill.bugzilla.org/bugzilla-5.0-branch/xmlrpc.cgi"
1819

19-
print("You can get an API key at "
20-
"https://landfill.bugzilla.org/bugzilla-5.0-branch/userprefs.cgi")
21-
print("after creating an account, if necessary. "
22-
"This is a test site, so no harm will come!")
23-
api_key = raw_input("Enter Bugzilla API Key: ")
20+
print("You can get an API key at:\n "
21+
" https://landfill.bugzilla.org/bugzilla-5.0-branch/userprefs.cgi")
22+
print("This is a test site, so no harm will come!\n")
23+
24+
if sys.version_info[0] >= 3:
25+
api_key = input("Enter Bugzilla API Key: ")
26+
else:
27+
api_key = raw_input("Enter Bugzilla API Key: ")
2428

2529
# API key usage assumes the API caller is storing the API key; if you would
2630
# like to use one of the login options that stores credentials on-disk for

0 commit comments

Comments
 (0)