in dh_virtualenv/deployment.py [0:0]
def find_script_files(self):
"""Find list of files containing python shebangs in the bin directory"""
command = ['grep', '-l', '-r',
'-e', r'^#!\({0}\|.*bin/\(env \)\?{0}\)'.format(_PYTHON_INTERPRETERS_REGEX),
'-e', r"^'''exec.*bin/{0}".format(_PYTHON_INTERPRETERS_REGEX),
self.bin_dir]
grep_proc = subprocess.Popen(command, stdout=subprocess.PIPE)
files, stderr = grep_proc.communicate()
return set(f for f in files.decode('utf-8').strip().split('\n') if f)