Fixed a problem removing temp files
authorPete Steinfeld <psteinfeld@nvidia.com>
Tue, 12 May 2020 20:10:32 +0000 (13:10 -0700)
committerPete Steinfeld <psteinfeld@nvidia.com>
Wed, 13 May 2020 18:40:19 +0000 (11:40 -0700)
commit72416b136ec67e3036add616875438dc93bec149
tree60aa43f9028702b9a1e05d3e912fc581953e2647
parent15426b2161a4680051f13dcf0824eeab602b25fa
Fixed a problem removing temp files

Summary:
Before making this change, whenever I ran "check-flang", I'd get an
error message like:

llvm-lit: /mnt/c/GitHub/f18/c751/flang/build/bin/../../../llvm/utils/lit/lit/main.py:252: warning: Failed to delete temp directory '/tmp/lit_tmp_gOKUIh'

With this change, there's no such message in the output, and the temp
directory is successfully removed.

Note that my working environment is on Windows 10 running Windows
Subsystem for Linux using the Ubuntu app.  I'm running Python version
2.7.1.

Earlier versions of Python do not contain `shutil`.  It may be that this
module was available on Windows systems later than other platforms.
Upgrading my version of Python made the problem go away

I don't believe that timing was a problem since inserting a long delay
didn't fix things.

So I added some text to the error message recommending that the user
upgrade their version of Python if they run into this problem.

Reviewers: yln, DavidTruby

Subscribers: delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79861
llvm/utils/lit/lit/main.py