diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-10-07 18:08:47 +0100 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-10-07 18:08:47 +0100 |
commit | 8fb9f4cf7b4b39ee8f4992d338181377c60d5ddc (patch) | |
tree | a286265356a31bac0770c70a80753bcbcd4807a7 /Modules/_multiprocessing/multiprocessing.c | |
parent | 81901490a021048dc452c92839016732dc3c2e23 (diff) | |
download | cpython-8fb9f4cf7b4b39ee8f4992d338181377c60d5ddc.tar.gz cpython-8fb9f4cf7b4b39ee8f4992d338181377c60d5ddc.zip |
Get rid of circular import and eliminate unprefixed exported symbols
from _multiprocessing.
Diffstat (limited to 'Modules/_multiprocessing/multiprocessing.c')
-rw-r--r-- | Modules/_multiprocessing/multiprocessing.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index eb05c62b0d0..110eff710ed 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -10,14 +10,12 @@ #include "multiprocessing.h" -PyObject *ProcessError, *BufferTooShort; - /* * Function which raises exceptions based on error codes */ PyObject * -mp_SetError(PyObject *Type, int num) +_PyMp_SetError(PyObject *Type, int num) { switch (num) { #ifdef MS_WINDOWS @@ -159,19 +157,12 @@ PyInit__multiprocessing(void) if (!module) return NULL; - /* Get copy of BufferTooShort */ - temp = PyImport_ImportModule("multiprocessing"); - if (!temp) - return NULL; - BufferTooShort = PyObject_GetAttrString(temp, "BufferTooShort"); - Py_XDECREF(temp); - #if defined(MS_WINDOWS) || \ (defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)) - /* Add SemLock type to module */ - if (PyType_Ready(&SemLockType) < 0) + /* Add _PyMp_SemLock type to module */ + if (PyType_Ready(&_PyMp_SemLockType) < 0) return NULL; - Py_INCREF(&SemLockType); + Py_INCREF(&_PyMp_SemLockType); { PyObject *py_sem_value_max; /* Some systems define SEM_VALUE_MAX as an unsigned value that @@ -182,10 +173,10 @@ PyInit__multiprocessing(void) py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX); if (py_sem_value_max == NULL) return NULL; - PyDict_SetItemString(SemLockType.tp_dict, "SEM_VALUE_MAX", + PyDict_SetItemString(_PyMp_SemLockType.tp_dict, "SEM_VALUE_MAX", py_sem_value_max); } - PyModule_AddObject(module, "SemLock", (PyObject*)&SemLockType); + PyModule_AddObject(module, "SemLock", (PyObject*)&_PyMp_SemLockType); #endif /* Add configuration macros */ |