]> git.lyx.org Git - features.git/commitdiff
Do not crash if the input file does not exist, instead warn and exit (fixes https...
authorJosé Matox <jamatos@lyx.org>
Tue, 15 Mar 2011 18:17:42 +0000 (18:17 +0000)
committerJosé Matox <jamatos@lyx.org>
Tue, 15 Mar 2011 18:17:42 +0000 (18:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37937 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/tex_copy.py

index dc6adacee4732ca8507107a6dccf56d0e029d9d7..224406840c34c0d0a2e3194fe32f7480247604c9 100644 (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()