From d9acf0a171fc40a85d40c7728702fa54a763fc7b Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sat, 14 Mar 2015 20:30:16 -0700 Subject: [PATCH] Don't show error in mkpodcastplaylist when pipe ends --- bin/mkpodcastplaylist | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/mkpodcastplaylist b/bin/mkpodcastplaylist index db14a92..3737b04 100755 --- a/bin/mkpodcastplaylist +++ b/bin/mkpodcastplaylist @@ -5,6 +5,7 @@ largest file/directory. It searches directories, getting their size and lists the first file in the largest direcotry. """ +import errno import os import sys @@ -94,11 +95,15 @@ def main(): headfile = directories[0].get_head_file() #headfile = headfile.replace('podcasts/', 'podcast/', 1) #print headfile - sys.stdout.write("%s\n" % headfile) + try: + sys.stdout.write("%s\n" % headfile) + except IOError as e: + if e.errno == errno.EPIPE: + return + raise e directories[0].remove_head_file() if directories[0].num_files() == 0: directories = directories[1:] if __name__ == "__main__": main() -