Skip to content

Commit

Permalink
mesonlib: Fix Popen_safe_legacy() stderr assumption
Browse files Browse the repository at this point in the history
It may be None. This was encountered with radare's build system on
Windows, where symbolextractor.py crashes without any output displayed.
  • Loading branch information
oleavr authored and jpakkane committed Feb 4, 2022
1 parent 5ad9e77 commit 02733bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/mesonlib/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ def Popen_safe_legacy(args: T.List[str], write: T.Optional[str] = None,
else:
o = o.decode(errors='replace').replace('\r\n', '\n')
if e is not None:
if sys.stderr.encoding:
if sys.stderr is not None and sys.stderr.encoding:
e = e.decode(encoding=sys.stderr.encoding, errors='replace').replace('\r\n', '\n')
else:
e = e.decode(errors='replace').replace('\r\n', '\n')
Expand Down

0 comments on commit 02733bc

Please sign in to comment.