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.s tdout)
============
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 :
(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:\Documen ts and Settings\Assemb leur_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
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.s tdout)
============
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 :
(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:\Documen ts and Settings\Assemb leur_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
Comment