1

我得到:

Traceback (most recent call last):
  File "/usr/local/bin/git-review", line 863, in <module>
    main()
  File "/usr/local/bin/git-review", line 796, in main
    needs_update = latest_is_newer()
  File "/usr/local/bin/git-review", line 147, in latest_is_newer
    if latest_version > StrictVersion(version):
  File "/usr/lib/python2.7/distutils/version.py", line 140, in __cmp__
    compare = cmp(self.version, other.version)
AttributeError: StrictVersion instance has no attribute 'version'

如何修复 git-review?

4

2 回答 2

4

当您传递NonetoStrictVersion或的版本时会发生此错误LooseVersion

对于 Git Review,发生这种情况是因为Matthew Flaschen 的回答中提到了一个无效文件导致None被传入。StrictVersion

于 2015-06-10T16:19:21.963 回答
1

删除文件:

~/.config/git-review/latest-version

这是由该位置的空文件或无效文件引起的(它用于在需要时推荐更新)。请参阅启动板 #1098873

如果文件被删除,它将自动重新生成。

于 2013-01-12T13:23:45.683 回答