Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26b3ebb commit 4d4dfb7Copy full SHA for 4d4dfb7
1 file changed
Modules/main.c
@@ -302,8 +302,13 @@ Py_Main(int argc, char **argv)
302
#endif
303
if (filename != NULL) {
304
if ((fp = fopen(filename, "r")) == NULL) {
305
- fprintf(stderr, "%s: can't open file '%s'\n",
306
- argv[0], filename);
+#ifdef HAVE_STRERROR
+ fprintf(stderr, "%s: can't open file '%s': [Errno %d] %s\n",
307
+ argv[0], filename, errno, strerror(errno));
308
+#else
309
+ fprintf(stderr, "%s: can't open file '%s': Errno %d\n",
310
+ argv[0], filename, errno);
311
+#endif
312
return 2;
313
}
314
else if (skipfirstline) {
0 commit comments