File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1024,11 +1024,17 @@ def restore_output(self, statement):
1024
1024
if statement .parsed .pipeTo :
1025
1025
# Pipe output from the command to the shell command via echo
1026
1026
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
+
1032
1038
os .remove (self ._temp_filename )
1033
1039
self ._temp_filename = None
1034
1040
You can’t perform that action at this time.
0 commit comments