【发布时间】:2019-06-22 07:43:30
【问题描述】:
今天我尝试在新分支中提交时,我通常从事的项目给了我以下错误:
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 86, in <module>
clang_format(f)
File ".git/hooks/pre-commit", line 41, in clang_format
action = raw_input('{} does not conform to clang-format rules. '
NameError: name 'raw_input' is not defined
知道如何解决这个问题吗?至少让我的代码提交。谢谢!
【问题讨论】:
-
这是一个 Python 错误。没有特定于 C++ 或 git 的内容。
-
如何让我的代码(在 c++ 项目中)提交?
-
好吧。我建议您问问自己,您最近是否在系统上安装了 Python 2 以换用 Python 3。这可以解释 Python 错误。
-
我的系统中根本没有使用 Python 2 ...
-
确实有人这样做了。
raw_input是 Python 2,在 Python 3 中简单地重命名为input。事情不会像那样随机中断,有人改变了钩子或你的系统。你需要弄清楚它是什么,我们不能为你做这件事。
标签: c++ git clang-format