diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c index fc5773c..bc543a4 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -302,8 +302,13 @@ Py_Main(int argc, char **argv) #endif if (filename != NULL) { if ((fp = fopen(filename, "r")) == NULL) { - fprintf(stderr, "%s: can't open file '%s'\n", - argv[0], filename); +#ifdef HAVE_STRERROR + fprintf(stderr, "%s: can't open file '%s': [Errno %d] %s\n", + argv[0], filename, errno, strerror(errno)); +#else + fprintf(stderr, "%s: can't open file '%s': Errno %d\n", + argv[0], filename, errno); +#endif return 2; } else if (skipfirstline) { |