summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 747c12f..d4c3314 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -655,13 +655,14 @@ Py_Main(int argc, wchar_t **argv)
if (fp == NULL) {
char *cfilename_buffer;
const char *cfilename;
+ int err = errno;
cfilename_buffer = _Py_wchar2char(filename, NULL);
if (cfilename_buffer != NULL)
cfilename = cfilename_buffer;
else
cfilename = "<unprintable file name>";
fprintf(stderr, "%ls: can't open file '%s': [Errno %d] %s\n",
- argv[0], cfilename, errno, strerror(errno));
+ argv[0], cfilename, err, strerror(err));
if (cfilename_buffer)
PyMem_Free(cfilename_buffer);
return 2;