diff options
author | Tim Potter <tpot@samba.org> | 2002-04-14 23:36:01 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-04-14 23:36:01 +0000 |
commit | f6da697708576f4ff3be0b3da5b7271754cbc1ef (patch) | |
tree | 043b7f78670ce201d2d12a34149514ed868385ee /source3/python | |
parent | 3540c42bf4ac403b4a82e970b0e3566ffdc48407 (diff) | |
download | samba-f6da697708576f4ff3be0b3da5b7271754cbc1ef.tar.gz samba-f6da697708576f4ff3be0b3da5b7271754cbc1ef.tar.bz2 samba-f6da697708576f4ff3be0b3da5b7271754cbc1ef.zip |
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)
Diffstat (limited to 'source3/python')
-rw-r--r-- | source3/python/py_spoolss_printers.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); |