aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-07-23 11:45:52 -0400
committerAnthony G. Basile <blueness@gentoo.org>2012-07-23 11:45:52 -0400
commit9d645eec26ef20d1bc6a347d0e94490870583d26 (patch)
tree69d60574c44c2e33c5da1c961bd09aeef703bbeb /scripts
parentscripts/revdep-pax: add sanity for OBJECT, SONAME, LIBRARY (diff)
downloadelfix-9d645eec26ef20d1bc6a347d0e94490870583d26.tar.gz
elfix-9d645eec26ef20d1bc6a347d0e94490870583d26.tar.bz2
elfix-9d645eec26ef20d1bc6a347d0e94490870583d26.zip
scripts/revdep-pax: add python2/3 compat raw_input()
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/revdep-pax13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index 7504877..d34acdc 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -7,6 +7,15 @@ import subprocess
import re
import pax
+
+#python2/3 compat input
+def get_input(prompt):
+ if sys.hexversion > 0x03000000:
+ return input(prompt)
+ else:
+ return raw_input(prompt)
+
+
def get_ldd_linkings(binary):
ldd_output = subprocess.Popen(['/usr/bin/ldd', binary], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
ldd_lines = ldd_output.stdout.read().decode().split('\n')
@@ -274,7 +283,7 @@ def run_binary(binary, verbose, mark, allyes):
if allyes:
ans = 'y'
else:
- ans = input('\tSet flags for %s (y/n): ' % library)
+ ans = get_input('\tSet flags for %s (y/n): ' % library)
if ans == 'y':
do_marking = True
break
@@ -367,7 +376,7 @@ def run_soname(name, verbose, use_soname, mark, allyes, executable_only):
if allyes:
ans = 'y'
else:
- ans = input('\tSet flags for %s (y/n): ' % binary)
+ ans = get_input('\tSet flags for %s (y/n): ' % binary)
if ans == 'y':
do_marking = True
break