changeset 51308:0bb5299800ca

pytype: only output the "pytype crashed" message on error If pytype did not crash while generating stub, that message is kind of confusing. It seems simple enough to avoid it in this case.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Dec 2023 16:30:32 +0100
parents f4a0806081f2
children 9c5bd485fbb6
files contrib/check-pytype.sh
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-pytype.sh	Wed Dec 20 22:17:03 2023 +0100
+++ b/contrib/check-pytype.sh	Wed Dec 20 16:30:32 2023 +0100
@@ -127,5 +127,7 @@
     -x mercurial/wireprotov1peer.py \
     -x mercurial/wireprotov1server.py
 
-echo 'pytype crashed while generating the following type stubs:'
-find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort
+if find .pytype/pyi -name '*.pyi' | xargs grep -ql '# Caught error'; then
+    echo 'pytype crashed while generating the following type stubs:'
+    find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort
+fi