summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-21 18:34:38 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-21 18:34:38 +0000
commit105d77cd158b396dec900d4568dbed46696cdc82 (patch)
treeb6b32d0f9b4d1a3ce2d33beaf63ab2baad225038
parenta3bde6b630f674e26d11151f4ea4636c7d08aef9 (diff)
downloadportage-105d77cd158b396dec900d4568dbed46696cdc82.tar.gz
portage-105d77cd158b396dec900d4568dbed46696cdc82.tar.bz2
portage-105d77cd158b396dec900d4568dbed46696cdc82.zip
Use input() instead of raw_input() when Python 3 is used.
svn path=/main/trunk/; revision=14358
-rw-r--r--pym/_emerge/userquery.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/_emerge/userquery.py b/pym/_emerge/userquery.py
index db8cc4c79..5da236007 100644
--- a/pym/_emerge/userquery.py
+++ b/pym/_emerge/userquery.py
@@ -38,7 +38,10 @@ def userquery(prompt, responses=None, colours=None):
print(bold(prompt), end=' ')
try:
while True:
- response=raw_input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
+ if sys.hexversion >= 0x3000000:
+ response=input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
+ else:
+ response=raw_input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
for key in responses:
# An empty response will match the first value in responses.
if response.upper()==key[:len(response)].upper():