From f6da697708576f4ff3be0b3da5b7271754cbc1ef Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 14 Apr 2002 23:36:01 +0000 Subject: Call PyErr_SetString instead of fprintf to stderr. Don't clean up talloc and cli_state on close printer. They will be destroyed in the handle dealloc function. (This used to be commit 4114fe5996f84dfd14855ffdf666e065446607b4) --- source3/python/py_spoolss_printers.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'source3/python/py_spoolss_printers.c') diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c index b0033405ad..decc52e080 100644 --- a/source3/python/py_spoolss_printers.c +++ b/source3/python/py_spoolss_printers.c @@ -52,12 +52,15 @@ PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw) if (!(cli = open_pipe_creds(computer_name, creds, cli_spoolss_initialise, NULL))) { - fprintf(stderr, "could not initialise cli state\n"); + + /* Error state set in open_pipe_creds() */ + goto done; } if (!(mem_ctx = talloc_init())) { - fprintf(stderr, "unable to initialise talloc context\n"); + PyErr_SetString(spoolss_error, + "unable to initialise talloc context\n"); goto done; } @@ -99,11 +102,6 @@ PyObject *spoolss_closeprinter(PyObject *self, PyObject *args) result = cli_spoolss_close_printer(hnd->cli, hnd->mem_ctx, &hnd->pol); - /* Cleanup samba stuf */ - - cli_shutdown(hnd->cli); - talloc_destroy(hnd->mem_ctx); - /* Return value */ Py_INCREF(Py_None); -- cgit