Skip to content

Commit d6766c6

Browse files
committed
Fix pretty=True and remove debugging
1 parent 313ccd1 commit d6766c6

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

Python/bltinmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,9 +2268,7 @@ builtin_print_impl(PyObject *module, PyObject * const *objects,
22682268
if (pretty == Py_True) {
22692269
/* Use default `pprint.PrettyPrinter` */
22702270
PyObject *printer_factory = PyImport_ImportModuleAttrString("pprint", "PrettyPrinter");
2271-
PyObject *printer = NULL;
22722271

2273-
PyObject_Print(printer_factory, stderr, 0);
22742272
if (!printer_factory) {
22752273
Py_DECREF(file);
22762274
return NULL;
@@ -2282,7 +2280,6 @@ builtin_print_impl(PyObject *module, PyObject * const *objects,
22822280
Py_DECREF(file);
22832281
return NULL;
22842282
}
2285-
PyObject_Print(printer, stderr, 0);
22862283
}
22872284
else if (pretty == Py_None) {
22882285
/* Don't use a pretty printer */
@@ -2319,7 +2316,6 @@ builtin_print_impl(PyObject *module, PyObject * const *objects,
23192316
Or, this currently calls `printer.pformat(object)` so a pretty printing protocol could
23202317
be implemented there. Or maybe we want a more generic method name.
23212318
*/
2322-
PyObject_Print(printer, stderr, 0);
23232319
if (printer) {
23242320
PyObject *prettified = PyObject_CallMethod(printer, "pformat", "O", objects[i]);
23252321

0 commit comments

Comments
 (0)