Try except - bug?
From: Askari (9974331_at_cvm.qc.ca)
Date: 12/30/03
- Next message: Rob Boyd: "FIXED - Re: build problems on Solaris 9"
- Previous message: Bob van der Poel: "Re: When to put my modules"
- Next in thread: Rene Pijlman: "Re: Try except - bug?"
- Reply: Rene Pijlman: "Re: Try except - bug?"
- Reply: Askari: "Re: Try except - bug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Dec 2003 08:51:58 -0800
Hi,
I have a problem with try except :
example
============
try:
print "bou!"
raise "ha!"
except:
try:
fileDest.close()
except NameError:
print "error"
except:
import traceback
traceback.print_exc(file=sys.stdout)
============
If I run this example alone, I have no problem :
result
============
bou!
error
============
but I can't understand why doesn't work in my program :
http://www.cvm.qc.ca/9974331/Temp/crypte.py
(too long for a copy and paste)
(note : it's at line 353)
(note : the language of this program is in french, sorry)
when I run my program, I have this error :
============
Traceback (most recent call last):
File "C:\Documents and Settings\Assembleur_Man\Bureau\Crypte.py",
line 355, in crypte
fileDest.close()
NameError: global name 'fileDest' is not defined
============
but I know that 'fileDest' is not always defined but I put this line
in a try-except!? :-( :-S
Askari
- Next message: Rob Boyd: "FIXED - Re: build problems on Solaris 9"
- Previous message: Bob van der Poel: "Re: When to put my modules"
- Next in thread: Rene Pijlman: "Re: Try except - bug?"
- Reply: Rene Pijlman: "Re: Try except - bug?"
- Reply: Askari: "Re: Try except - bug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]