mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
be more suspicious of getlocals()
This commit is contained in:
parent
bdd207af79
commit
53bb7fff11
1 changed files with 8 additions and 2 deletions
|
@ -1105,7 +1105,8 @@ builtin_raw_input(self, args)
|
||||||
if (!newgetargs(args, "|O:[raw_]input", &v))
|
if (!newgetargs(args, "|O:[raw_]input", &v))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (getfilefile(sysget("stdin")) == stdin &&
|
if (getfilefile(sysget("stdin")) == stdin &&
|
||||||
getfilefile(sysget("stdout")) == stdout) {
|
getfilefile(sysget("stdout")) == stdout &&
|
||||||
|
isatty(fileno(stdin)) && isatty(fileno(stdout))) {
|
||||||
object *po;
|
object *po;
|
||||||
char *prompt;
|
char *prompt;
|
||||||
char *s;
|
char *s;
|
||||||
|
@ -1366,6 +1367,11 @@ builtin_vars(self, args)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
d = getlocals();
|
d = getlocals();
|
||||||
|
if (d == NULL) {
|
||||||
|
if (!err_occurred())
|
||||||
|
err_setstr(SystemError, "no locals!?");
|
||||||
|
}
|
||||||
|
else
|
||||||
INCREF(d);
|
INCREF(d);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue