super not working in __del__ ?

Christopher J. Bottaro cjbottaro at alumni.cs.utexas.edu
Tue Feb 15 18:34:42 EST 2005


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.




More information about the Python-list mailing list