我该如何解决“StrictVersion实例没有属性'版本'”在git审查 [英] How do I fix "StrictVersion instance has no attribute 'version'" in git review

查看:228
本文介绍了我该如何解决“StrictVersion实例没有属性'版本'”在git审查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到:
$ b $ pre $ Traceback(最近调用最后一个):
文件/ usr / local / bin / git-review,第863行,在< module>
main()
在main
needs_update = latest_is_newer()
文件中的/ usr / local / bin / git-review,第796行,/ usr / local / bin / git-review,第147行,在latest_is_newer
中if latest_version> StrictVersion(版本):
文件/usr/lib/python2.7/distutils/version.py,第140行,在__cmp__
compare = cmp(self.version,other.version)
AttributeError:StrictVersion实例没有属性'version'

如何修正git-review?

解决方案

当您将 None 版本传递给 StrictVersion LooseVersion



对于Git Review,发生这种情况是因为无效文件导致 None 被传递到 StrictVersion ,正如Matthew Flaschen的回答中所述。


I get:

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'

How do I fix git-review?

解决方案

This error happens when you pass a version of None to StrictVersion or LooseVersion.

For Git Review, this happens because of an invalid file causing None to be passed into StrictVersion as mentioned in Matthew Flaschen's answer.

这篇关于我该如何解决“StrictVersion实例没有属性'版本'”在git审查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆