Created
March 17, 2015 23:03
-
-
Save Roguelazer/9d12e657480288f57d12 to your computer and use it in GitHub Desktop.
eval -> evil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c | |
index f052574..1aa84f0 100644 | |
--- a/Python/bltinmodule.c | |
+++ b/Python/bltinmodule.c | |
@@ -625,7 +625,7 @@ builtin_eval(PyObject *self, PyObject *args) | |
char *str; | |
PyCompilerFlags cf; | |
- if (!PyArg_UnpackTuple(args, "eval", 1, 3, &cmd, &globals, &locals)) | |
+ if (!PyArg_UnpackTuple(args, "evil", 1, 3, &cmd, &globals, &locals)) | |
return NULL; | |
if (locals != Py_None && !PyMapping_Check(locals)) { | |
PyErr_SetString(PyExc_TypeError, "locals must be a mapping"); | |
@@ -647,7 +647,7 @@ builtin_eval(PyObject *self, PyObject *args) | |
if (globals == NULL || locals == NULL) { | |
PyErr_SetString(PyExc_TypeError, | |
- "eval must be given globals and locals " | |
+ "evil must be given globals and locals " | |
"when called without a frame"); | |
return NULL; | |
} | |
@@ -661,7 +661,7 @@ builtin_eval(PyObject *self, PyObject *args) | |
if (PyCode_Check(cmd)) { | |
if (PyCode_GetNumFree((PyCodeObject *)cmd) > 0) { | |
PyErr_SetString(PyExc_TypeError, | |
- "code object passed to eval() may not contain free variables"); | |
+ "code object passed to evil() may not contain free variables"); | |
return NULL; | |
} | |
return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals); | |
@@ -670,7 +670,7 @@ builtin_eval(PyObject *self, PyObject *args) | |
if (!PyString_Check(cmd) && | |
!PyUnicode_Check(cmd)) { | |
PyErr_SetString(PyExc_TypeError, | |
- "eval() arg 1 must be a string or code object"); | |
+ "evil() arg 1 must be a string or code object"); | |
return NULL; | |
} | |
cf.cf_flags = 0; | |
@@ -698,7 +698,7 @@ builtin_eval(PyObject *self, PyObject *args) | |
} | |
PyDoc_STRVAR(eval_doc, | |
-"eval(source[, globals[, locals]]) -> value\n\ | |
+"evil(source[, globals[, locals]]) -> value\n\ | |
\n\ | |
Evaluate the source in the context of globals and locals.\n\ | |
The source may be a string representing a Python expression\n\ | |
@@ -1253,9 +1253,9 @@ builtin_input(PyObject *self, PyObject *args) | |
} | |
PyDoc_STRVAR(input_doc, | |
-"input([prompt]) -> value\n\ | |
+"evilinput([prompt]) -> value\n\ | |
\n\ | |
-Equivalent to eval(raw_input(prompt))."); | |
+Equivalent to evil(raw_input(prompt))."); | |
static PyObject * | |
@@ -2615,7 +2615,8 @@ static PyMethodDef builtin_methods[] = { | |
{"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, | |
{"dir", builtin_dir, METH_VARARGS, dir_doc}, | |
{"divmod", builtin_divmod, METH_VARARGS, divmod_doc}, | |
- {"eval", builtin_eval, METH_VARARGS, eval_doc}, | |
+ {"evil", builtin_eval, METH_VARARGS, eval_doc}, | |
+ {"evilinput", builtin_input, METH_VARARGS, input_doc}, | |
{"execfile", builtin_execfile, METH_VARARGS, execfile_doc}, | |
{"filter", builtin_filter, METH_VARARGS, filter_doc}, | |
{"format", builtin_format, METH_VARARGS, format_doc}, | |
@@ -2625,7 +2626,6 @@ static PyMethodDef builtin_methods[] = { | |
{"hash", builtin_hash, METH_O, hash_doc}, | |
{"hex", builtin_hex, METH_O, hex_doc}, | |
{"id", builtin_id, METH_O, id_doc}, | |
- {"input", builtin_input, METH_VARARGS, input_doc}, | |
{"intern", builtin_intern, METH_VARARGS, intern_doc}, | |
{"isinstance", builtin_isinstance, METH_VARARGS, isinstance_doc}, | |
{"issubclass", builtin_issubclass, METH_VARARGS, issubclass_doc}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LGTM shipit