if (!newgetargs(args, "|O:[raw_]input", &v))
return NULL;
if (getfilefile(sysget("stdin")) == stdin &&
- getfilefile(sysget("stdout")) == stdout) {
+ getfilefile(sysget("stdout")) == stdout &&
+ isatty(fileno(stdin)) && isatty(fileno(stdout))) {
object *po;
char *prompt;
char *s;
return NULL;
if (v == NULL) {
d = getlocals();
- INCREF(d);
+ if (d == NULL) {
+ if (!err_occurred())
+ err_setstr(SystemError, "no locals!?");
+ }
+ else
+ INCREF(d);
}
else {
d = getattr(v, "__dict__");