Skip to content

Commit fb08a9b

Browse files
committed
fixing the requirements. Pigar versions
1 parent 76a2b4b commit fb08a9b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

inspect4py/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import ast
23
import os
34
import re
@@ -99,9 +100,14 @@ def extract_requirements(input_path):
99100
# Answering yes (echo y), we allow searching for PyPI
100101
# for the missing modules and filter some unnecessary modules.
101102

102-
cmd = 'echo y | pigar -P ' + input_path + ' -p ' + file_name
103-
# cmd = 'echo n | pigar -P ' + input_path + ' -p ' + file_name
104-
print("cmd: %s" %cmd)
103+
104+
#print(sys.version_info)
105+
if sys.version_info[0] <=3 and sys.version_info[1]<=9:
106+
cmd = 'echo y | pigar -P ' + input_path + ' -p ' + file_name
107+
else:
108+
cmd = ' pigar generate ' + input_path + ' -f ' + file_name + ' --question-answer yes --auto-select'
109+
110+
#print("-----> cmd: %s" %cmd)
105111
proc = subprocess.Popen(cmd.encode('utf-8'), shell=True, stdin=subprocess.PIPE,
106112
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
107113
stdout, stderr = proc.communicate()

0 commit comments

Comments
 (0)