Skip to content

Commit 93e9fd3

Browse files
committed
pywrap and fix tests
1 parent 154691f commit 93e9fd3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/diffpy/pdffit2/output.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,13 @@ def redirect_stdout(dst):
3838
stdout = dst
3939
return
4040

41+
def restore_stdout():
42+
"""Restore the standard output."""
43+
from diffpy.pdffit2.pdffit2 import restore_stdout
44+
45+
restore_stdout()
46+
global stdout
47+
return
48+
4149

4250
# End of file

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def _capture(f, *args, **kwargs):
4545
f(*args, **kwargs)
4646
finally:
4747
diffpy.pdffit2.redirect_stdout(savestdout)
48+
diffpy.pdffit2.output.restore_stdout()
4849
return fp.getvalue()
4950

5051
return _capture

0 commit comments

Comments
 (0)