[libcxx-commits] [PATCH] D93137: generate_header_tests.py: Sort the header files ASCIIbetically.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 11 14:06:52 PST 2020

Quuxplusone marked an inline comment as done.
Quuxplusone added inline comments.

Comment at: libcxx/utils/generate_header_tests.py:140
-    include_headers = glob.glob(pattern, recursive=False)
+    files = sorted([f for f in glob.glob(pattern, recursive=False)])
curdeius wrote:
> Doesn't that work? Glob returns a list (so an iterable, nope?).
You're right. Fixed now.
Irrelevant but maybe entertaining backstory: After making my initial patch, I had been getting a weird hang/freeze and (upon Ctrl+C) the error message
^CFailed checking if argv[0] is an import path entry
Traceback (most recent call last):
  File "<frozen zipimport>", line 92, in __init__
KeyError: '/Users/aodwyer/llvm-project/libcxx/utils/generate_header_tests.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 94, in __init__
  File "<frozen zipimport>", line 354, in _read_directory
which I just glanced at, saw it was something about "reading directories" and "zip [iterators?]," and foolishly concluded that the `sorted(glob.glob(...))` was the issue. I changed it to `sorted(list)`, the weird error went away, and I posted the diff. **But,** I see now that that error message was coming from me somehow screwing up my virtualenv; it had absolutely nothing to do with `sorted(glob.glob(...))`; and its going away right then was completely coincidental.



More information about the libcxx-commits mailing list