~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/script.py

  • Committer: Martin Pool
  • Date: 2009-12-11 05:29:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4892.
  • Revision ID: mbp@sourcefrog.net-20091211052935-4zh2rzzs1djtoih6
Clearer syntax error message from ScriptRunner

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                error = []
108
108
            error.append(line[2:] + '\n')
109
109
        else:
 
110
            # can happen if the first line is not recognized as a command, eg
 
111
            # if the prompt has leading whitespace
110
112
            if output is None:
111
113
                if cmd_cur is None:
112
 
                    raise SyntaxError('No command for that output',
 
114
                    raise SyntaxError('No command for line %r' % (line,),
113
115
                                      (file_name, lineno, 1, orig))
114
116
                output = []
115
117
            output.append(line + '\n')