@@ -820,29 +820,39 @@ def do_pastebin_helper(self, s):
820820 self .interact .notify ('Posting data to pastebin...' )
821821
822822 try :
823- helper = subprocess .Popen ('' , executable = self .config .pastebin_helper ,
824- stdin = subprocess .PIPE , stdout = subprocess .PIPE )
823+ helper = subprocess .Popen ('' ,
824+ executable = self .config .pastebin_helper ,
825+ stdin = subprocess .PIPE ,
826+ stdout = subprocess .PIPE )
825827 helper .stdin .write (s .encode (getpreferredencoding ()))
826- paste_url = helper .communicate ()[0 ].decode (getpreferredencoding ()).split ()[0 ]
828+ output = helper .communicate ()[0 ].decode (getpreferredencoding ())
829+ paste_url = output .split ()[0 ]
827830 except OSError , e :
828831 if e .errno == errno .ENOENT :
829- self .interact .notify ('Upload failed: Helper program not found.' )
832+ self .interact .notify ('Upload failed: '
833+ 'Helper program not found.' )
830834 else :
831- self .interact .notify ('Upload failed: Helper program could not be run.' )
835+ self .interact .notify ('Upload failed: '
836+ 'Helper program could not be run.' )
832837 return
833838
834839 if helper .returncode != 0 :
835- self .interact .notify ('Upload failed: Helper program returned non-zero exit status %s.' %
836- (helper .returncode , ))
840+ self .interact .notify ('Upload failed: '
841+ 'Helper program returned non-zero exit '
842+ 'status %s.' % (helper .returncode , ))
837843 return
838844
839845 if not paste_url :
840- self .interact .notify ('Upload failed: No output from helper program.' )
846+ self .interact .notify ('Upload failed: '
847+ 'No output from helper program.' )
841848 return
842849 else :
843850 parsed_url = urlparse (paste_url )
844- if not parsed_url .scheme or any (unicodedata .category (char ) == 'Cc' for char in paste_url ):
845- self .interact .notify ("Upload failed: Failed to recognize the helper program's output as an URL." )
851+ if (not parsed_url .scheme
852+ or any (unicodedata .category (char ) == 'Cc' for c in paste_url )):
853+ self .interact .notify ("Upload failed: "
854+ "Failed to recognize the helper "
855+ "program's output as an URL." )
846856 return
847857
848858 self .prev_pastebin_content = s
0 commit comments