summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 4d54dad..a710652 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -235,10 +235,9 @@ set_hook(const char *funcname, PyObject **hook_var, PyObject *args)
Py_XDECREF(tmp);
}
else {
- PyOS_snprintf(buf, sizeof(buf),
- "set_%.50s(func): argument not callable",
- funcname);
- PyErr_SetString(PyExc_TypeError, buf);
+ PyErr_Format(PyExc_TypeError,
+ "set_%.50s(func): argument not callable",
+ funcname);
return NULL;
}
Py_RETURN_NONE;
@@ -892,7 +891,7 @@ setup_readline(void)
#endif
#ifdef __APPLE__
- /* the libedit readline emulation resets key bindings etc
+ /* the libedit readline emulation resets key bindings etc
* when calling rl_initialize. So call it upfront
*/
if (using_libedit_emulation)
@@ -932,11 +931,11 @@ setup_readline(void)
*/
#ifdef __APPLE__
if (using_libedit_emulation)
- rl_read_init_file(NULL);
+ rl_read_init_file(NULL);
else
#endif /* __APPLE__ */
rl_initialize();
-
+
RESTORE_LOCALE(saved_locale)
}