Skip to content

Commit 88b6f92

Browse files
committed
remove temparory fix
1 parent 6180000 commit 88b6f92

File tree

5 files changed

+0
-49
lines changed

5 files changed

+0
-49
lines changed

src/diffpy/pdffit2/output.py

-9
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,4 @@ def redirect_stdout(dst):
3939
return
4040

4141

42-
def restore_stdout():
43-
"""Restore the standard output."""
44-
from diffpy.pdffit2.pdffit2 import restore_stdout
45-
46-
restore_stdout()
47-
global stdout
48-
return
49-
50-
5142
# End of file

src/extensions/pdffit2module/bindings.cc

-4
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,6 @@ struct PyMethodDef pypdffit2_methods[] = {
330330
{pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout,
331331
METH_VARARGS, pypdffit2_redirect_stdout__doc__},
332332

333-
//restore_stdout
334-
{pypdffit2_restore_stdout__name__, pypdffit2_restore_stdout,
335-
METH_VARARGS, pypdffit2_restore_stdout__doc__},
336-
337333
//is_element
338334
{pypdffit2_is_element__name__, pypdffit2_is_element,
339335
METH_VARARGS, pypdffit2_is_element__doc__},

src/extensions/pdffit2module/misc.cc

-30
Original file line numberDiff line numberDiff line change
@@ -2201,36 +2201,6 @@ PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args)
22012201
return Py_None;
22022202
}
22032203

2204-
// restore_stdout
2205-
char pypdffit2_restore_stdout__doc__[] =
2206-
"Restore engine output to the default stream (std::cout).";
2207-
char pypdffit2_restore_stdout__name__[] =
2208-
"restore_stdout";
2209-
2210-
PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *args)
2211-
{
2212-
// no arguments.
2213-
if (!PyArg_ParseTuple(args, ""))
2214-
return 0;
2215-
2216-
// If the global output stream pointer is not std::cout, then delete the custom stream.
2217-
if (NS_PDFFIT2::pout != &std::cout)
2218-
{
2219-
delete NS_PDFFIT2::pout;
2220-
NS_PDFFIT2::pout = &std::cout;
2221-
}
2222-
2223-
// Clean up the custom stream buffer
2224-
if (py_stdout_streambuf)
2225-
{
2226-
delete py_stdout_streambuf;
2227-
py_stdout_streambuf = nullptr;
2228-
}
2229-
2230-
Py_INCREF(Py_None);
2231-
return Py_None;
2232-
}
2233-
22342204
// is_element
22352205
char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table.";
22362206
char pypdffit2_is_element__name__[] = "is_element";

src/extensions/pdffit2module/misc.h

-5
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,6 @@ extern char pypdffit2_redirect_stdout__name__[];
477477
extern "C"
478478
PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *);
479479

480-
// restore_stdout
481-
extern char pypdffit2_restore_stdout__doc__[];
482-
extern char pypdffit2_restore_stdout__name__[];
483-
extern "C"
484-
PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *);
485480

486481
// is_element
487482
extern char pypdffit2_is_element__doc__[];

tests/conftest.py

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def _capture(f, *args, **kwargs):
4545
f(*args, **kwargs)
4646
finally:
4747
diffpy.pdffit2.redirect_stdout(savestdout)
48-
diffpy.pdffit2.output.restore_stdout()
4948
return fp.getvalue()
5049

5150
return _capture

0 commit comments

Comments
 (0)