Skip to content
Snippets Groups Projects
Commit c331c154d249 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:ambulance: in conf2reST, use pip3 when pip is not found

parent f550ff30da97
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,15 @@
# pip freeze
reqs = dict()
for element in subprocess.check_output(['pip', 'freeze']).split():
try:
pip_freeze = subprocess.check_output(['pip', 'freeze'])
except OSError as e:
if e.errno == os.errno.ENOENT:
pip_freeze = subprocess.check_output(['pip3', 'freeze'])
else:
# Something else went wrong
raise
for element in pip_freeze.split():
lib_and_version = element.decode('utf-8').split('==')
if len(lib_and_version) == 1: # No explicit version (no ==).
library, version = lib_and_version[0], "N/A"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment