Import('env') import os import glob def cleanup(target, source, env): """Clean up example outputs""" for x in glob.glob("log_file*.pym") + ['initial.pym']: try: os.unlink(x) except OSError: pass ex = env.IMPModuleExamples(example_files=env.IMPModuleGetExamples(), data_files=env.IMPModuleGetExampleData()) env.AddPostAction(ex, cleanup)