Note that there are some explanatory texts on larger screens.

plurals
  1. POPython's help() in Maya 2012 acting quite strange
    primarykey
    data
    text
    <p>This seems completely unrelated to the contents of the code, so I'll keep it generic.</p> <p>I was adding a multiline docstring to the last class at the bottom of one of my modules - just something that adds labels to things - and when I imported the module via Maya's script editor and ran a help(module.Class) on that class, I received this error:</p> <pre><code># Error: IndexError: file C:\Program Files\Autodesk\Maya2012\bin\python26.zip\inspect.py line 568: list index out of range # </code></pre> <p>I spent awhile narrowing down what about the multiline string was causing the error, paring it down to working with 1 or 2 lines, but failing beyond that. I tried moving the large, multiline comment to another class and doing a help on that, and it worked fine, so it seemed the comment was not at issue. I then did a help on the new last class in the module, and it failed. It seemed like position near the end was the issue.</p> <p>I moved the comment back to the failing class and removed all of its code and did a help(), and it worked fine. I started adding back in methods, and it worked all the way up until the last one, which had only one line of code in it. I changed every part of it - renamed it, removed args, swapped its one line of code for a pass - help for the class always failed until I removed it outright. Help did work on the module.Class.method, so the method itself, and its big, multiline comment seemed okay.</p> <p>I then moved the entire class up in the module file to before the class right before it. Help now worked for it. However, now help failed for the last class in the file, though it doesn't even have a docstring. I moved the class back to the bottom, and started playing with the things at the end of it. It seemed to have a problem with the last method, meaning even if I deleted many before them - more text than deleting just the one at the end - I'd still get a problem. I added a docstring to the last method and help failed, but adding a docstring (just a "whatever") to the last three made it work again. This whole thing is completely baffling.</p> <p>Is this a known issue that I've somehow missed? It seems like some class/method configurations can kill help unless all methods - especially the more than lightly complicated ones - have docstrings.</p> <p>editing to add a small bit of code as an example:</p> <pre><code>def setLabelChangeDGC (self, control): control.dragCallback = self.getLabelChangeDGC(control) </code></pre> <p>That was the final method of the final class in the file. It caused help to crash. Removing this method would allow help to work on the class again. However, leaving this in and moving the class itself above the previous class would cause it to work fine again for this class, but then begin to fail on the new final class in the file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload