diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-07-23 11:45:52 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-07-23 11:45:52 -0400 |
commit | 9d645eec26ef20d1bc6a347d0e94490870583d26 (patch) | |
tree | 69d60574c44c2e33c5da1c961bd09aeef703bbeb /scripts | |
parent | scripts/revdep-pax: add sanity for OBJECT, SONAME, LIBRARY (diff) | |
download | elfix-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-x | scripts/revdep-pax | 13 |
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 |