From 12c69fa0546f9d6b485a5e7ca1ebd250143a27b1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 18 Jul 2012 16:30:46 +0000 Subject: [PATCH] Fix for empty snippet files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etgtools/sphinx_generator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 92cb2ee7..0c80d6e9 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1399,6 +1399,11 @@ class Snippet(Node): while 1: tline = fid.readline() + if not tline: # end of file + code = "" + fid.close() + break + if not tline.strip(): continue