exception problem

C

Charles Hixson

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

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

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top