super not working in __del__ ?

  • Thread starter Christopher J. Bottaro
  • Start date
C

Christopher J. Bottaro

I get this exception when I run the following code:

Exception exceptions.TypeError: 'super() argument 1 must be type, not None'
in <bound method Txrposdn.__del__ of <__main__.Txrposdn object at
0xf6f7118c>> ignored

Here is the code:

class Txrposdn(PRI.BasicBatch):

def __init__(self, *argv):
super(Txrposdn, self).__init__(*argv)

def __del__(self):
super(Txrposdn, self).__del__()

if __name__ == "__main__":
prog = Txrposdn(args)
prog.go()


The weird thing is that if move that last code segment into its own
function, the exception doesn't happen:

def main():
prog = Txrposdn(args)
prog.go()

if __name == "__main__":
main()

What is going on? Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top