changeset 33938:8a8dd6e4a97a

contrib: make import-checker agree more with run-tests about heredocpy run-tests.py and import-checker.py take wholly different approaches to .t-tests, and the result was that they had different notions about when a Python heredoc had ended, leading to conflicts. This resolves part of the issue, and the rest I can deal with by tweaking the one offending test file.
author Augie Fackler <raf@durin42.com>
date Tue, 22 Aug 2017 16:37:06 -0400
parents 5ed0be4d9df9
children a4c1333b2eda
files contrib/import-checker.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/import-checker.py	Tue Aug 22 15:28:54 2017 -0400
+++ b/contrib/import-checker.py	Tue Aug 22 16:37:06 2017 -0400
@@ -693,7 +693,10 @@
             else:
                 script.append(l[4:])
             continue
-        if inlinepython and l == b'  \n':
+        # If we have an empty line or a command for sh, we end the
+        # inline script.
+        if inlinepython and (l == b'  \n'
+                             or l.startswith(b'  $ ')):
             yield b''.join(script), (b"%s[%d]" %
                    (modname, inlinepython)), t, inlinepython
             script = []