如何解决“StrictVersion实例没有属性‘版本’”在git的审查(How do I fix

2019-10-17 14:07发布

我得到:

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'

如何解决混帐评论?

Answer 1:

当你传递一个版本的情况发生这个错误NoneStrictVersionLooseVersion

对于Git的审查,这是因为无效的文件造成的None传递到StrictVersion在马修•富兰琛的答复中提到。



Answer 2:

删除文件:

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

这是通过在该位置空的或无效的文件引起的(需要时用于推荐更新)。 见快速启动#1098873

如果文件被删除,它会自动再生。



文章来源: How do I fix “StrictVersion instance has no attribute 'version'” in git review