python/psutil/psutil/_psutil_common.c

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

     1 /*
     2  * Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
     3  * Use of this source code is governed by a BSD-style license that can be
     4  * found in the LICENSE file.
     5  *
     6  * Routines common to all platforms.
     7  */
     9 #include <Python.h>
    12 /*
    13  * Set OSError(errno=ESRCH, strerror="No such process") Python exception.
    14  */
    15 PyObject *
    16 NoSuchProcess(void) {
    17     PyObject *exc;
    18     char *msg = strerror(ESRCH);
    19     exc = PyObject_CallFunction(PyExc_OSError, "(is)", ESRCH, msg);
    20     PyErr_SetObject(PyExc_OSError, exc);
    21     Py_XDECREF(exc);
    22     return NULL;
    23 }
    25 /*
    26  * Set OSError(errno=EACCES, strerror="Permission denied") Python exception.
    27  */
    28 PyObject *
    29 AccessDenied(void) {
    30     PyObject *exc;
    31     char *msg = strerror(EACCES);
    32     exc = PyObject_CallFunction(PyExc_OSError, "(is)", EACCES, msg);
    33     PyErr_SetObject(PyExc_OSError, exc);
    34     Py_XDECREF(exc);
    35     return NULL;
    36 }

mercurial