On 10/30/2015 11:52 AM, Zac Medico wrote:
> On 10/30/2015 11:00 AM, Mike Frysinger wrote:
> 
>> +    try:
>> +            # Set up a single tempdir for all the tests to use.
>> +            # This way we know the tests won't leak things on us.
>> +            tempdir = tempfile.mkdtemp(prefix='portage.runtests.')
> [snip]
>> +    finally:
>> +            if opts.keep_temp:
>> +                    print('Temporary directory left behind:\n%s' % tempdir)
>> +            else:
>> +                    # Nuke our tempdir and anything that might be under it.
>> +                    shutil.rmtree(tempdir, True)
>>  
>>      # Then summarize it all.
>>      print('\nSummary:\n')
>>
> 
> This will raise NameError if mkdtemp for some reason. For absolute
> correctness, you need to call mkdtemp before try, or set tempdir = None
> before the try and check that it's not None before calling rmtree.
> 

I mean, "if mkdtemp fails for some reason." Other then that issue, the
patch looks good.
-- 
Thanks,
Zac

Reply via email to