summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2010-12-03 20:14:31 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2010-12-03 20:14:31 (GMT)
commit4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9 (patch)
treec8f1fef715f8d158e58f17cab14af65455de1d77 /Python
parentc4df7845143f9afe0d20f4421a41904f3cbb991a (diff)
downloadcpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.zip
cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.gz
cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.bz2
Merge branches/pep-0384.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c4
-rw-r--r--Python/ceval.c7
-rw-r--r--Python/dynload_shlib.c2
-rw-r--r--Python/dynload_win.c14
-rw-r--r--Python/import.c2
-rw-r--r--Python/pythonrun.c12
6 files changed, 32 insertions, 9 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f300ab2..765464a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -727,7 +727,7 @@ builtin_eval(PyObject *self, PyObject *args)
"code object passed to eval() may not contain free variables");
return NULL;
}
- return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals);
+ return PyEval_EvalCode(cmd, globals, locals);
}
cf.cf_flags = PyCF_SOURCE_IS_UTF8;
@@ -803,7 +803,7 @@ builtin_exec(PyObject *self, PyObject *args)
"contain free variables");
return NULL;
}
- v = PyEval_EvalCode((PyCodeObject *) prog, globals, locals);
+ v = PyEval_EvalCode(prog, globals, locals);
}
else {
char *str;
diff --git a/Python/ceval.c b/Python/ceval.c
index 140112f..684c6c2 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -755,7 +755,7 @@ static int _Py_TracingPossible = 0;
PyObject *
-PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
{
return PyEval_EvalCodeEx(co,
globals, locals,
@@ -3059,10 +3059,11 @@ exit_eval_frame:
the test in the if statements in Misc/gdbinit (pystack and pystackv). */
PyObject *
-PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
+PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
PyObject **args, int argcount, PyObject **kws, int kwcount,
PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure)
{
+ PyCodeObject* co = (PyCodeObject*)_co;
register PyFrameObject *f;
register PyObject *retval = NULL;
register PyObject **fastlocals, **freevars;
@@ -3968,7 +3969,7 @@ fast_function(PyObject *func, PyObject ***pp_stack, int n, int na, int nk)
d = &PyTuple_GET_ITEM(argdefs, 0);
nd = Py_SIZE(argdefs);
}
- return PyEval_EvalCodeEx(co, globals,
+ return PyEval_EvalCodeEx((PyObject*)co, globals,
(PyObject *)NULL, (*pp_stack)-n, na,
(*pp_stack)-2*nk, nk, d, nd, kwdefs,
PyFunction_GET_CLOSURE(func));
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 3d0fb5e..7ea510e 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -53,6 +53,8 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
#else /* !__VMS */
{"." SOABI ".so", "rb", C_EXTENSION},
{"module." SOABI ".so", "rb", C_EXTENSION},
+ {".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
+ {"module.abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
{".so", "rb", C_EXTENSION},
{"module.so", "rb", C_EXTENSION},
#endif /* __VMS */
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index e7d61ce..73a1dcf 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -134,6 +134,15 @@ static char *GetPythonImport (HINSTANCE hModule)
!strncmp(import_name,"python",6)) {
char *pch;
+#ifndef _DEBUG
+ /* In a release version, don't claim that python3.dll is
+ a Python DLL. */
+ if (strcmp(import_name, "python3.dll") == 0) {
+ import_data += 20;
+ continue;
+ }
+#endif
+
/* Ensure python prefix is followed only
by numbers to the end of the basename */
pch = import_name + 6;
@@ -162,13 +171,16 @@ static char *GetPythonImport (HINSTANCE hModule)
return NULL;
}
-
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
char funcname[258], *import_python;
+#ifndef _DEBUG
+ _Py_CheckPython3();
+#endif
+
PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
{
diff --git a/Python/import.c b/Python/import.c
index ce7cbc2..23752ee 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -806,7 +806,7 @@ PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname,
PyErr_Clear(); /* Not important enough to report */
Py_DECREF(v);
- v = PyEval_EvalCode((PyCodeObject *)co, d, d);
+ v = PyEval_EvalCode(co, d, d);
if (v == NULL)
goto error;
Py_DECREF(v);
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index de8e9da..3f6385d 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1755,7 +1755,7 @@ run_mod(mod_ty mod, const char *filename, PyObject *globals, PyObject *locals,
co = PyAST_Compile(mod, filename, flags, arena);
if (co == NULL)
return NULL;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
Py_DECREF(co);
return v;
}
@@ -1785,7 +1785,7 @@ run_pyc_file(FILE *fp, const char *filename, PyObject *globals,
return NULL;
}
co = (PyCodeObject *)v;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
if (v && flags)
flags->cf_flags |= (co->co_flags & PyCF_MASK);
Py_DECREF(co);
@@ -1817,6 +1817,14 @@ Py_CompileStringFlags(const char *str, const char *filename, int start,
return (PyObject *)co;
}
+/* For use in Py_LIMITED_API */
+#undef Py_CompileString
+PyObject *
+PyCompileString(const char *str, const char *filename, int start)
+{
+ return Py_CompileStringFlags(str, filename, start, NULL);
+}
+
struct symtable *
Py_SymtableString(const char *str, const char *filename, int start)
{