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

RW richard_wheeler at cinfin.com
Fri Jan 17 15:56:59 EST 2003


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()




More information about the Python-list mailing list