diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 6 | ||||
-rw-r--r-- | Modules/config.c.in | 4 | ||||
-rw-r--r-- | Modules/main.c | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 842ebb2..6f06270 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2171,7 +2171,7 @@ KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep) return 0; } ob = CData_GetContainer(target); - if (ob->b_objects == NULL || !PyDict_Check(ob->b_objects)) { + if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) { Py_XDECREF(ob->b_objects); ob->b_objects = keep; /* refcount consumed */ return 0; @@ -4544,7 +4544,7 @@ Pointer_init(CDataObject *self, PyObject *args, PyObject *kw) { PyObject *value = NULL; - if (!PyArg_ParseTuple(args, "|O:POINTER", &value)) + if (!PyArg_UnpackTuple(args, "POINTER", 0, 1, &value)) return -1; if (value == NULL) return 0; @@ -4946,7 +4946,7 @@ cast(void *ptr, PyObject *src, PyObject *ctype) } Py_XINCREF(obj->b_objects); result->b_objects = obj->b_objects; - if (result->b_objects && PyDict_Check(result->b_objects)) { + if (result->b_objects && PyDict_CheckExact(result->b_objects)) { PyObject *index; int rc; index = PyLong_FromVoidPtr((void *)src); diff --git a/Modules/config.c.in b/Modules/config.c.in index 17b700f..653faaf 100644 --- a/Modules/config.c.in +++ b/Modules/config.c.in @@ -28,6 +28,7 @@ extern void PyMarshal_Init(void); extern void initimp(void); extern void initgc(void); extern void init_ast(void); +extern void _PyWarnings_Init(void); struct _inittab _PyImport_Inittab[] = { @@ -50,6 +51,9 @@ struct _inittab _PyImport_Inittab[] = { /* This lives in gcmodule.c */ {"gc", initgc}, + /* This lives in _warnings.c */ + {"_warnings", _PyWarnings_Init}, + /* Sentinel */ {0, 0} }; diff --git a/Modules/main.c b/Modules/main.c index 4af2e77..46eb4bb 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -45,7 +45,7 @@ static wchar_t **orig_argv; static int orig_argc; /* command line options */ -#define BASE_OPTS L"bBc:dEhim:OStuvVW:xX?" +#define BASE_OPTS L"bBc:dEhiJm:OStuvVW:xX?" #define PROGRAM_OPTS BASE_OPTS @@ -345,6 +345,8 @@ Py_Main(int argc, wchar_t **argv) Py_InteractiveFlag++; break; + /* case 'J': reserved for Jython */ + case 'O': Py_OptimizeFlag++; break; @@ -378,6 +380,8 @@ Py_Main(int argc, wchar_t **argv) skipfirstline = 1; break; + /* case 'X': reserved for non-standard arguments */ + case 'h': case '?': help++; |