diff options
author | Tim Harder <radhermit@gmail.com> | 2021-03-21 11:54:16 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-03-21 11:54:16 -0600 |
commit | 056f5a6da6176874dfd6be93a640bc4df37243d1 (patch) | |
tree | 0adfc1aa1910435391d84d5da96d6181f101ccf6 /src/snakeoil/process | |
parent | dist.generate_docs: drop script support (diff) | |
download | snakeoil-056f5a6da6176874dfd6be93a640bc4df37243d1.tar.gz snakeoil-056f5a6da6176874dfd6be93a640bc4df37243d1.tar.bz2 snakeoil-056f5a6da6176874dfd6be93a640bc4df37243d1.zip |
process.spawn: drop unused find_invoking_python()
pkgcore doesn't use it anymore since it uses IPC when the ebd needs
python support.
Diffstat (limited to 'src/snakeoil/process')
-rw-r--r-- | src/snakeoil/process/spawn.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/snakeoil/process/spawn.py b/src/snakeoil/process/spawn.py index 9340936..bde5df5 100644 --- a/src/snakeoil/process/spawn.py +++ b/src/snakeoil/process/spawn.py @@ -434,30 +434,3 @@ def is_userpriv_capable(force=False): pass res = is_userpriv_capable.cached_result = (os.getuid() == 0) return res - - -_invoking_python = None -def find_invoking_python(): - # roughly... use sys.executable if possible, then major ver variations- - # look for python2.5, python2, then just python, for example - # NOTE: sys.executable in unreliable if the interpreter is embedded - global _invoking_python - if _invoking_python is not None and os.path.exists(_invoking_python): - return _invoking_python - if os.path.exists(sys.executable): - test_input = "oh hai" - returncode, output = spawn_get_output( - [sys.executable, '-c', 'print("%s")' % test_input], collect_fds=(1, 2)) - if output and output[0].strip() == test_input: - _invoking_python = sys.executable - return _invoking_python - - chunks = list(str(x) for x in sys.version_info[:2]) - for potential in (chunks, chunks[:-1], ''): - try: - command_name = 'python%s' % '.'.join(potential) - _invoking_python = find_binary(command_name) - return _invoking_python - except CommandNotFound: - continue - raise CommandNotFound('python') |