Skip to content

Commit ea9cc2f

Browse files
committed
fixup(1c3a83b): PyRun_XxString always returns false
1 parent 5dffaea commit ea9cc2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/pythonrun.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,15 @@ template PyRun_String*(str; mode; globals; locals): PyObject =
251251
bind PyRun_StringFlags
252252
PyRun_StringFlags(str, mode, globals, locals)
253253

254-
template errPrint(dict; call){.dirty.} =
254+
template errPrint(dict; call): bool{.dirty.} =
255255
let dict = getMainDict()
256256
let res = call
257257
if res.isThrownException:
258258
let exc = PyBaseErrorObject(res)
259259
PyErr_Print exc
260+
false
261+
else:
262+
true
260263

261264
proc PyRun_SimpleStringFlagsWithName*(str; name: string, flags=initPyCompilerFlags()): bool{.pyCFuncPragma.} =
262265
## `_PyRun_SimpleStringFlagsWithName`

0 commit comments

Comments
 (0)