我明白了:
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?
答案 0 :(得分:3)
将None
版本传递给StrictVersion
或LooseVersion
时会发生此错误。
对于Git Review,这是因为文件无效导致None
被传递到StrictVersion
,如Matthew Flaschen的回答所述。
答案 1 :(得分:1)
删除文件:
~/.config/git-review/latest-version
这是由该位置的空文件或无效文件引起的(它用于在需要时推荐更新)。见Launchpad #1098873
如果文件被删除,它将自动重新生成。