diff options
author | 2014-12-25 20:58:56 -0800 | |
---|---|---|
committer | 2014-12-25 20:58:56 -0800 | |
commit | 9403b0561283b504880e5808dd9efada2c89eeb8 (patch) | |
tree | 1e21381fc81a092b3b52f8ae0a8a4abe55655718 /gkeys | |
parent | gkeys: Update fetchseed, verify actions to work with the new category system (diff) | |
download | gentoo-keys-9403b0561283b504880e5808dd9efada2c89eeb8.tar.gz gentoo-keys-9403b0561283b504880e5808dd9efada2c89eeb8.tar.bz2 gentoo-keys-9403b0561283b504880e5808dd9efada2c89eeb8.zip |
gkeys/actions.py: py2/py3 fixes for input/raw_input
Diffstat (limited to 'gkeys')
-rw-r--r-- | gkeys/gkeys/actions.py | 11 |
1 files 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."] |