From: fred Date: Tue, 26 Mar 2002 22:15:07 +0000 (+0000) Subject: lilypond-1.1.61 X-Git-Tag: release/1.5.59~2288 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4b7788132487194e2fa3ad1fd380ae4e9361d825;p=lilypond.git lilypond-1.1.61 --- diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index ddc1138316..86ebadd0ea 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -322,6 +322,8 @@ class TeXOutput: \\end{document} """) this.__fd.close() + if os.path.isfile(outfile): + os.remove(outfile) if ( os.name == 'posix' ): stat = os.system('latex \'\\nonstopmode \\input %s\'' % (this.__outfile)) @@ -330,11 +332,11 @@ class TeXOutput: (this.__outfile)) if stat: sys.exit('ExitBadLatex') - if os.path.isfile(outfile): - os.remove(outfile) - os.rename(this.__base + '.' + str(os.getpid()) + '.dvi', outfile) - sys.stderr.write( '\n' + program_id() + ': dvi file name is %s\n\n' - % (outfile)) + if not os.path.isfile(outfile): + os.rename(this.__base + '.' + str(os.getpid()) + '.dvi', outfile) + + sys.stderr.write('\n' + program_id() + ': dvi file name is %s\n\n' + % (outfile)) if Props.get('postscript'): psoutfile=this.__base + '.ps'