From: José Matox Date: Tue, 15 Mar 2011 18:17:42 +0000 (+0000) Subject: Do not crash if the input file does not exist, instead warn and exit (fixes https... X-Git-Tag: 2.0.0~514 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=89bf17bfec3b294fbd54f1e5278a8f130c4c2308;p=features.git 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 --- diff --git a/lib/scripts/tex_copy.py b/lib/scripts/tex_copy.py index dc6adacee4..224406840c 100644 --- a/lib/scripts/tex_copy.py +++ b/lib/scripts/tex_copy.py @@ -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()