[all-commits] [llvm/llvm-project] 42f90a: [extract_symbols.py] Fix line-splitting of tool ou...

Simon Tatham via All-commits all-commits at lists.llvm.org
Wed Jan 12 01:08:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42f90a28a32dd97734fe3f502831a82bd9706795
      https://github.com/llvm/llvm-project/commit/42f90a28a32dd97734fe3f502831a82bd9706795
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/utils/extract_symbols.py

  Log Message:
  -----------
  [extract_symbols.py] Fix line-splitting of tool output.

Two functions in the `is_32bit_windows` family were retrieving the
output of a tool via `subprocess.check_output`, and then iterating
over it using `for line in output`. But in Python, that gets you the
output one //character// at a time, not a line at a time. So the
regexes that looked for a platform name were never matching.

(This is a mistake that Python makes uniquely easy, because iterating
over a file and over a string have different default behaviour, and
because the element type of a string is still a string so you don't
even get a type mismatch error to warn you about it!)

Reviewed By: michaelplatings

Differential Revision: https://reviews.llvm.org/D117030




More information about the All-commits mailing list