On 2012-07-03 18:06, Marco Giusti wrote:
On Tue, Jul 03, 2012 at 05:45:57PM +0200, Matteo Boscolo wrote:
prova con ..
try:
bla bla
except SystemExit:
return
except:
bla bla
forse
try:
bla bla
except SystemExit:
raise
excep
On Tue, Jul 03, 2012 at 05:45:57PM +0200, Matteo Boscolo wrote:
> prova con ..
>
> try:
> bla bla
> except SystemExit:
> return
> except:
> bla bla
forse
try:
bla bla
except SystemExit:
raise
except:
bla bla
__
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Il 03/07/2012 17:45, Matteo Boscolo ha scritto:
> prova con ..
>
> try:
> bla bla
> except SystemExit:
> return
> except:
> bla bla
>
Meglio:
except SystemExit:
# rilancia l'eccezione
raise
> [...]
Saluti Manlio
-
prova con ..
try:
bla bla
except SystemExit:
return
except:
bla bla
Il 03/07/2012 17:11, Luca Bacchi ha scritto:
http://docs.python.org/library/sys.html#sys.exit
sys.exit scatena una eccezione "SystemExit"
Il 03 luglio 2012 17:06, Vittorio Spina ha scritto:
ma quale errore lo
>
> http://docs.python.org/library/sys.html#sys.exit
>
> sys.exit scatena una eccezione "SystemExit"
>
Ok. Capito l'inghippo !!!
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python
2012/7/3 Luca Bacchi :
> http://docs.python.org/library/sys.html#sys.exit
>
> sys.exit scatena una eccezione "SystemExit"
forse stai facendo un try..except troppo generico, tipo:
try:
v = func_che_genera_eccezione()
if not v:
sys.exit()
except:
print u'qualcosa è andato storto
http://docs.python.org/library/sys.html#sys.exit
sys.exit scatena una eccezione "SystemExit"
Il 03 luglio 2012 17:06, Vittorio Spina ha scritto:
> ma quale errore lo scatena? porta tutto fuori dal try un attimo e riporta
> l'errore...
>
>
> Il 03/07/2012 17:03, Walter Valenti ha scritto:
>
>> Ho
ma quale errore lo scatena? porta tutto fuori dal try un attimo e
riporta l'errore...
Il 03/07/2012 17:03, Walter Valenti ha scritto:
Ho all'interno di un blocco "try" una condizione,
per cui lo script può uscire regolarmente con sys.exit(0).
Questo però mi scatena l'esecuzione del blocco "ex