def get_auto_shell():
"""Return the shell that is calling this process"""
try:
import psutil
parent = psutil.Process(os.getpid()).parent()
if platform.system() == 'Windows':
parent = parent.parent() or parent
return parent.name().replace('.exe', '')
except ImportError:
raise click.UsageError("Please explicitly give the shell type or install the psutil package to activate the"
" automatic shell detection.")
评论列表
文章目录