Skip to content

Commit 7b2c5fb

Browse files
committed
bug fix: plot(dump=True) works with complex terminal strings
There are two bugs here. This patch fixes only the breakage we get with dump=True. Prior to this patch we'd try to access self.fdDupSTDOUT even when it doesn't exist. The next patch will fix the incomplete terminal detection
1 parent 22bba4c commit 7b2c5fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

gnuplotlib.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,10 +2346,12 @@ def plot_process_header():
23462346
self._safelyWriteToPipe('set output',
23472347
'output')
23482348
else:
2349-
if self.fdDupSTDOUT is None:
2350-
raise GnuplotlibError("I need to plot to STDOUT, but STDOUT wasn't available")
2351-
2352-
self.processOptions['output'] = '/dev/fd/' + str(self.fdDupSTDOUT)
2349+
if not _data_dump_only(self.processOptions):
2350+
if self.fdDupSTDOUT is None:
2351+
raise GnuplotlibError("I need to plot to STDOUT, but STDOUT wasn't available")
2352+
self.processOptions['output'] = '/dev/fd/' + str(self.fdDupSTDOUT)
2353+
else:
2354+
self.processOptions['output'] = '/dev/fd/DUMPONLY'
23532355
self._safelyWriteToPipe('set output "' + self.processOptions['output'] + '"',
23542356
'output')
23552357

0 commit comments

Comments
 (0)