From 5aaa09f58c2487b107e8fe64cd61600304f68f9d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 30 Apr 2009 22:05:32 +0000 Subject: a new attempt at handling socket exceptions so that the error can be logged svn path=/trunk/; revision=11213 --- scripts/load_every_help.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/load_every_help.py b/scripts/load_every_help.py index a7121c9b..6a4a0392 100755 --- a/scripts/load_every_help.py +++ b/scripts/load_every_help.py @@ -39,11 +39,7 @@ def make_netreceive_patch(filename): def send_to_socket(message): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - try: - s.connect(('localhost', PORT)) - except: - # TODO for now just ignore socket errors.... - pass + s.connect(('localhost', PORT)) s.send(message) s.close() @@ -132,13 +128,16 @@ for root, dirs, files in os.walk(docdir): m = re.search(".*\.pd$", name) if m: print 'checking ' + name + patchoutput = [] patch = os.path.join(root, m.string) p = launch_pd() - open_patch(patch) - time.sleep(1) - close_patch(patch) - quit_pd(p) - patchoutput = [] + try: + open_patch(patch) + time.sleep(1) + close_patch(patch) + quit_pd(p) + except socket.error: + patchoutput.append('socket.error') while True: line = p.stdout.readline() m = re.search('EOF on socket', line) -- cgit v1.2.1