commit: 9403b0561283b504880e5808dd9efada2c89eeb8 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Fri Dec 26 04:58:56 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Fri Dec 26 04:58:56 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=9403b056
gkeys/actions.py: py2/py3 fixes for input/raw_input --- gkeys/gkeys/actions.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index dddd48a..aa1aa08 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -13,6 +13,13 @@ from __future__ import print_function import os +import sys + +if sys.version_info[0] >= 3: + py_input = input +else: + py_input = raw_input + from collections import defaultdict from json import load @@ -494,10 +501,10 @@ class Actions(object): success = False else: self.output(['', [gkey]], '\n Found GKEY seed:') - ans = raw_input("Do you really want to remove %s?[y/n]: " + ans = py_input ("Do you really want to remove %s?[y/n]: " % kwargs['nick']).lower() while ans not in ["yes", "y", "no", "n"]: - ans = raw_input("Do you really want to remove %s?[y/n]: " + ans = py_input ("Do you really want to remove %s?[y/n]: " % kwargs['nick']).lower() if ans in ["no", "n"]: messages = ["Key removal aborted... Nothing to be done."]