Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Unified Diff: Python/_warnings.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Python/thread_wince.h ('k') | Tools/gdb/libpython.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Python/_warnings.c Tue Jul 26 09:37:46 2011 +0300
+++ b/Python/_warnings.c Mon Jul 25 09:47:18 2011 -0400
@@ -409,10 +409,10 @@
else {
PyObject *res;
- if (!PyCallable_Check(show_fxn)) {
+ if (!PyMethod_Check(show_fxn) && !PyFunction_Check(show_fxn)) {
PyErr_SetString(PyExc_TypeError,
"warnings.showwarning() must be set to a "
- "callable");
+ "function or method");
Py_DECREF(show_fxn);
goto cleanup;
}
@@ -496,7 +496,7 @@
/* Setup filename. */
*filename = PyDict_GetItemString(globals, "__file__");
- if (*filename != NULL && PyUnicode_Check(*filename)) {
+ if (*filename != NULL) {
Py_ssize_t len = PyUnicode_GetSize(*filename);
Py_UNICODE *unicode = PyUnicode_AS_UNICODE(*filename);
@@ -517,7 +517,6 @@
}
else {
const char *module_str = _PyUnicode_AsString(*module);
- *filename = NULL;
if (module_str == NULL)
goto handle_error;
if (strcmp(module_str, "__main__") == 0) {
« no previous file with comments | « Python/thread_wince.h ('k') | Tools/gdb/libpython.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+