We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c8a9cd8 + 96d7042 commit b70a575Copy full SHA for b70a575
PyStand.cpp
@@ -341,10 +341,12 @@ const char *init_script =
341
" fp = os.fdopen(fd, 'w')\n"
342
" sys.stdout = fp\n"
343
" sys.stderr = fp\n"
344
+" attached = True\n"
345
"except Exception as e:\n"
346
" fp = open(os.devnull, 'w')\n"
347
348
349
+" attached = False\n"
350
#endif
351
"for n in ['.', 'lib', 'site-packages']:\n"
352
" test = os.path.abspath(os.path.join(PYSTAND_HOME, n))\n"
@@ -358,7 +360,9 @@ const char *init_script =
358
360
"try:\n"
359
361
" code = compile(text, PYSTAND_SCRIPT, 'exec')\n"
362
" exec(code, environ)\n"
-"except:\n"
363
+"except Exception:\n"
364
+" if attached:\n"
365
+" raise\n"
366
" import traceback, io\n"
367
" sio = io.StringIO()\n"
368
" traceback.print_exc(file = sio)\n"
0 commit comments