Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Reproducible PS/PDF output (master)#6597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
c6a4660
4e477dc
946ae45
22f71a2
ad660d7
37c28b4
2e1c773
541f97e
2a6ebc8
6ee8967
a3185e6
8f095f6
c007f49
ecbdd55
65ec88e
5b405cc
d10a21e
da55bb6
c56dae7
995173d
eef6b12
fb529da
ebff832
f6301c2
1786555
af4213e
bf7387e
2cdc577
76bec02
bbab0c5
1a5ada6
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,6 +2,8 @@ | ||
Provides utilities to test output reproducibility. | ||
""" | ||
import six | ||
import io | ||
import os | ||
import re | ||
@@ -53,7 +55,13 @@ def _determinism_save(objects='mhi', format="pdf"): | ||
x = range(5) | ||
fig.add_subplot(1, 6, 6).plot(x, x) | ||
if six.PY2 and format == 'ps': | ||
stdout = io.StringIO() | ||
else: | ||
stdout = getattr(sys.stdout, 'buffer', sys.stdout) | ||
fig.savefig(stdout, format=format) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why not just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It does not work with the PS backend, which tries to wrap the input in | ||
if six.PY2 and format == 'ps': | ||
sys.stdout.write(stdout.getvalue()) | ||
# Restores SOURCE_DATE_EPOCH | ||
if sde is None: | ||