How do I fix “StrictVersion instance has no attribute 'version'” in git review

谁都会走 提交于 2019-12-24 09:05:23

问题


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?


回答1:


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.




回答2:


Remove the file:

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

This is caused by an empty or invalid file at that location (it is used for recommending updates when needed). See Launchpad #1098873

If the file is removed, it will automatically be regenerated.



来源:https://stackoverflow.com/questions/14293727/how-do-i-fix-strictversion-instance-has-no-attribute-version-in-git-review

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!