Skip to content

Commit e1de97d

Browse files
authored
Merge pull request #2100 from jepler/issue-2092
Fix exception in ;py, comment
2 parents 0b61588 + d3498c9 commit e1de97d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/emc/pythonplugin/python_plugin.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ std::string handle_pyerror()
235235
bp::object formatted_list, formatted;
236236

237237
PyErr_Fetch(&exc, &val, &tb);
238+
PyErr_NormalizeException(&exc, &val, &tb);
239+
238240
bp::handle<> hexc(exc), hval(bp::allow_null(val)), htb(bp::allow_null(tb));
239241
bp::object traceback(bp::import("traceback"));
240242
if (!tb) {

src/emc/sai/driver.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
InterpBase *pinterp;
4444
#define interp_new (*pinterp)
4545
const char *prompt = "READ => ";
46-
const char *history = "~/.rs274";
46+
const char *histfile = "~/.rs274";
4747
#define RS274_HISTORY "RS274_HISTORY"
4848

4949
#define active_settings interp_new.active_settings
@@ -137,15 +137,15 @@ void initialize_readline ()
137137
rl_readline_name = "rs274";
138138

139139
if ((s = getenv(RS274_HISTORY)))
140-
history = s;
140+
histfile = s;
141141
// tilde-expand
142-
if (wordexp(history, &p, WRDE_SHOWERR|WRDE_UNDEF )) {
142+
if (wordexp(histfile, &p, WRDE_SHOWERR|WRDE_UNDEF )) {
143143
perror("wordexp");
144144
} else {
145-
history = strdup(p.we_wordv[0]);
145+
histfile = strdup(p.we_wordv[0]);
146146
}
147-
if (history)
148-
read_history(history);
147+
if (histfile)
148+
read_history(histfile);
149149
}
150150

151151
/***********************************************************************/
@@ -186,8 +186,8 @@ int interpret_from_keyboard( /* ARGUMENTS */
186186
{
187187
line = readline ( prompt);
188188
if (!line || strcmp (line, "quit") == 0) {
189-
if (history)
190-
write_history(history);
189+
if (histfile)
190+
write_history(histfile);
191191
return 0;
192192
}
193193
if (*line)

0 commit comments

Comments
 (0)