2.2.2 generates: "TypeError: 'module' object is not callable"

John Roth johnroth at ameritech.net
Fri Jan 17 22:09:35 CET 2003


"RW" <richard_wheeler at cinfin.com> wrote in message
news:5e536696.0301171256.1d3d9c48 at posting.google.com...
> Calls to the class dcHelper below works fine under 2.2.1 but now
> breaks under 2.2.2 with the error: "TypeError: 'module' object is not
> callable".
>
> The processResults() method is called recursively.  The first time
> that dcHelper class is called is while it is in a recursive call.  The
> dcHelper object generated is then passed to processResults() in a
> recursive call later.  However in the 2.2.2 version it gets the
> TypeError on the very first call to dcHelper before it can pass it
> another recursive call to ProcessResults().
> Can anyone help me with this?  Platform is Win2K using ActiveState
> 2.2.2 distribution of python.
>
> Thanks
>
> Prototype Example:
>
> def processResults( dc = None ):
>     class dcHelper( object ):
>         def __new__( cls, whichway, alist ):
>             self = super( dcHelper, cls ).__new__( cls )
>             self.diff_files = []
>             self.subdirs = {}
>             if whichway == 'left_only':
>                 self.right_only = []
>                 self.left_only = alist
>             else:
>                 self.right_only = alist
>                 self.left_only = []
>             return self
>
>     if dc == None
>         processResults( '.' )
>
>     if dc == '.':
>         pathName = dc
>         name = 'x'
>
>         diff_dirs[name] = dcHelper( 'right_only', os.listdir(pathName)
> )
>         processResults( diff_dirs[name] )
>
> processResults()

What's the module called?
Is the class in this module, or in another one?
If it's in another one, how is it imported?

John Roth







More information about the Python-list mailing list