summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 0937cce..c2c9e90 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -2938,28 +2938,30 @@ Py_Exit(int sts)
int
Py_FdIsInteractive(FILE *fp, const char *filename)
{
- if (isatty((int)fileno(fp)))
+ if (isatty(fileno(fp))) {
return 1;
- if (!Py_InteractiveFlag)
+ }
+ if (!_Py_GetConfig()->interactive) {
return 0;
- return (filename == NULL) ||
- (strcmp(filename, "<stdin>") == 0) ||
- (strcmp(filename, "???") == 0);
+ }
+ return ((filename == NULL)
+ || (strcmp(filename, "<stdin>") == 0)
+ || (strcmp(filename, "???") == 0));
}
int
_Py_FdIsInteractive(FILE *fp, PyObject *filename)
{
- if (isatty((int)fileno(fp))) {
+ if (isatty(fileno(fp))) {
return 1;
}
- if (!Py_InteractiveFlag) {
+ if (!_Py_GetConfig()->interactive) {
return 0;
}
- return (filename == NULL) ||
- (PyUnicode_CompareWithASCIIString(filename, "<stdin>") == 0) ||
- (PyUnicode_CompareWithASCIIString(filename, "???") == 0);
+ return ((filename == NULL)
+ || (PyUnicode_CompareWithASCIIString(filename, "<stdin>") == 0)
+ || (PyUnicode_CompareWithASCIIString(filename, "???") == 0));
}