Choral Music for Holy Week - Chanticleer_Mysteria- Gregorian Chants_10_Holy Sunday- Hymn- Vexilla Regis.mp3 (07/11), exception problem

Alex cut_me_out at hotmail.com
Fri Apr 14 10:46:14 EDT 2000


> from uu import *
> decode(infile, outfile)
> 
> raise Error, 'No valid begin line found in input file'
> uu.Error: No valid begin line found in input file
> 
> 
> how do i trap it
> 
> i've tried
> 
> try:
>     decode(infile, outfile)
> except uu.error:
>     pass
> 
> gives me
> 
> NameError uu :

I'm not sure, but I think you've bought all of uu into your current
namespace.  If that's the case, you probably want

try:
    decode(infile, outfile)
except error:
    pass

...except that 'error' should probably be 'Error' judging by the
traceback.

On the face of it, it seems like you would be better off keeping uu in
its own namespace in this case:

import uu
try:
    uu.decode (infile, outfile)
except: uu.Error
    pass

Alex.



More information about the Python-list mailing list