Do not crash if the input file does not exist, instead warn and exit (fixes https://bugzilla.redhat.com/show_bug.cgi?id=595618)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37937 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2011-03-15 18:17:42 +00:00
parent 101cabc355
commit 89bf17bfec

View File

@ -54,6 +54,8 @@ def main(argv):
latex_base, latex_ext = os.path.splitext(latex_file)
# Read the input file and write the output file
if(not os.path.isfile(abs_from_file)):
error("%s is not a valid file.\n" % abs_from_file)
from_file = open(abs_from_file, 'rb')
to_file = open(abs_to_file, 'wb')
lines = from_file.readlines()