Python 3:AttributeError:从git bash启动时,“NoneType”对象没有“提示”属性

问题描述

我有一个使用 prompt_toolkit 库的 python 3 应用程序。如果我通过 cmdPowerShell 启动应用程序,则应用程序启动不会出现问题。但是,当我通过 Windows git bash 启动应用程序时,出现以下错误:-

Traceback (most recent call last):
  File "application.py",line 313,in <module>
    ret_code = main(str(args.com))
  File "application.py",line 170,in main
    s_opt = session.prompt(f"{s_time} >")
  AttributeError: 'nonetype' object has no attribute 'prompt'

这在 git bash 上失败而不是在 cmd/PowerShell 上失败的任何原因,有没有办法克服这个问题,以便我可以从 git bash 运行我的应用程序?

我使用的是 Python v3.8.3、prompt-toolkit v3.0.5 和 git bash v2.26.2.windows.1,在 Windows 10 上运行。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)