nicolashainaux / sphinx-autodoc-annotation

Use Python 3 annotations in sphinx-enabled docstrings
BSD 3-Clause "New" or "Revised" License
43 stars 5 forks source link

Fix IndexError: list index out of range #3

Closed zoni closed 8 years ago

zoni commented 8 years ago

This fixes the issue described in #2.

I'm not sure this is the perfect fix as I'm completely unfamiliar with Sphinx' internals, but it doesn't appear to have any negative side effects and at first glance, doesn't appear to cause any missing annotations either.

ghost commented 8 years ago

Thanks for the PR @zoni. I never thought this would ever be used by somebody. I don't use it myself, so if you're actually using it, I would gladly pass ownership to you.

That being said, I'm reluctant to accept the PR as-is for two reasons:

  1. We don't know the root cause of the bug. What is result when we get this index error and why is it thus?
  2. Why the as e if you don't use e?
nicolashainaux commented 8 years ago

Hum, I had the same problem but looking at the code of the freshly pip-installed version, I noticed it is not the one from the github repo. There's not if result: test. It crashes with the IndexError too. Adding the missing if result: solves the case, no need for an Exception handling there.

Maybe @zoni has not noticed the difference and so has suggested a patch that fixes the error in a similar way the if result: line already does.

So maybe the problem is the PyPI version, that is not up-to-date?

nicolashainaux commented 8 years ago

I just updated the PyPI version: this pull request looks useless now, so I close it.