summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index ace63ff..cbcc6fa 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -738,7 +738,7 @@ PyErr_ProgramText(const char *filename, int lineno)
int i;
char linebuf[1000];
- if (filename == NULL || lineno <= 0)
+ if (filename == NULL || *filename == '\0' || lineno <= 0)
return NULL;
fp = fopen(filename, "r" PY_STDIOTEXTMODE);
if (fp == NULL)