exception problem

Charles Hixson charleshixsn at earthlink.net
Sun Jun 24 18:26:59 EDT 2012


The code:
                 print    ("pre-chunkLine")
                 chunks    =    []
                 try:
                     chunks    =    self.chunkLine (l)
                 except:
                     print    ("caught exception")
                     print (sys.exc_info()[:2])
                 finally:
                     print ("at finally")
                 print ("chunks =")
                 print (repr(chunks), ".", end = ":")
produces this result:
   . . ., by
pre-chunkLine
caught exception
at finally
path  3...

Any suggestions as to what's wrong with the code?
FWIW, chunkLine begins:
     def chunkLine (self, line):
         print    ("chunkLine: ")
         print ("line = ", line)
         if    line == None:
             return    []
         assert    (isinstance (line, str) )

-- 
Charles Hixson




More information about the Python-list mailing list