At Wednesday 18/10/2006 22:51, Cameron Walsh wrote:

    previous_directory = os.getcwd()
    try:
        os.chdir(directory)
        [ ... ]
        return modules
    finally:
        os.chdir(previous_directory)

Woah, that actually works?  Having the "finally" after the "return"?
That could make some things easier, and some things harder...

Note that moving the return statement after the finally does *exactly* the same thing, generates shorter code, and is a lot more readable (IMHO).


--
Gabriel Genellina
Softlab SRL

        
        
                
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! http://www.yahoo.com.ar/respuestas

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to