File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1024,11 +1024,17 @@ def restore_output(self, statement):
10241024 if statement .parsed .pipeTo :
10251025 # Pipe output from the command to the shell command via echo
10261026 command_line = r'cat {} | {}' .format (self ._temp_filename , statement .parsed .pipeTo )
1027- result = subprocess .check_output (command_line , shell = True )
1028- if six .PY3 :
1029- self .stdout .write (result .decode ())
1030- else :
1031- self .stdout .write (result )
1027+
1028+ # Get the output and display it. Ignore non-zero return codes and print nothing.
1029+ try :
1030+ result = subprocess .check_output (command_line , shell = True )
1031+ if six .PY3 :
1032+ self .stdout .write (result .decode ())
1033+ else :
1034+ self .stdout .write (result )
1035+ except subprocess .CalledProcessError :
1036+ pass
1037+
10321038 os .remove (self ._temp_filename )
10331039 self ._temp_filename = None
10341040
You can’t perform that action at this time.
0 commit comments