contrib/import-checker.py
changeset 33920 8a8dd6e4a97a
parent 33919 5ed0be4d9df9
child 34038 bc2535238de2
equal deleted inserted replaced
33919:5ed0be4d9df9 33920:8a8dd6e4a97a
   691                 script = []
   691                 script = []
   692                 shpython = 0
   692                 shpython = 0
   693             else:
   693             else:
   694                 script.append(l[4:])
   694                 script.append(l[4:])
   695             continue
   695             continue
   696         if inlinepython and l == b'  \n':
   696         # If we have an empty line or a command for sh, we end the
       
   697         # inline script.
       
   698         if inlinepython and (l == b'  \n'
       
   699                              or l.startswith(b'  $ ')):
   697             yield b''.join(script), (b"%s[%d]" %
   700             yield b''.join(script), (b"%s[%d]" %
   698                    (modname, inlinepython)), t, inlinepython
   701                    (modname, inlinepython)), t, inlinepython
   699             script = []
   702             script = []
   700             inlinepython = 0
   703             inlinepython = 0
   701             continue
   704             continue