Generator problem: parent class not seen

Chris Rebert crebert at ucsd.edu
Wed Feb 1 23:34:45 CET 2012


On Wed, Feb 1, 2012 at 1:00 PM, Russell E. Owen <rowen at uw.edu> wrote:
> I have an odd and very intermittent problem in Python script.
> Occasionally it fails with this error:
>
> Traceback (most recent call last):
>  File
> "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas
> eFocusScript.py", line 884, in run
>  File
> "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas
> eFocusScript.py", line 1690, in initAll
> TypeError: unbound method initAll() must be called with BaseFocusScript
> instance as first argument (got ScriptClass instance instead)
<snip>
> The code looks like this:
>
>    def run(self, sr):
>        try:
>            self.initAll()
<snip>
> I am puzzled why Python thinks the class type is wrong, given the output
> of inspect.getclasstree. Any ideas on what might be wrong and how to
> track it down (and why it would be so intermittent)?

What's the offending line of initAll() [#1690 in BaseFocusScript.py]
look like? The lines preceding it would also be helpful for context.

Cheers,
Chris



More information about the Python-list mailing list