comparison Python/errors.c @ 85420:ef889c3d5dc6

Issue #18571: Implementation of the PEP 446: file descriptors and file handles are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
author Victor Stinner <victor.stinner@gmail.com>
date Wed, 28 Aug 2013 00:53:59 +0200
parents df2fdd42b375
children bfaf3a2907bd
comparison
equal deleted inserted replaced
85419:0872257752c2 85420:ef889c3d5dc6
1040 PyErr_ProgramText(const char *filename, int lineno) 1040 PyErr_ProgramText(const char *filename, int lineno)
1041 { 1041 {
1042 FILE *fp; 1042 FILE *fp;
1043 if (filename == NULL || *filename == '\0' || lineno <= 0) 1043 if (filename == NULL || *filename == '\0' || lineno <= 0)
1044 return NULL; 1044 return NULL;
1045 fp = fopen(filename, "r" PY_STDIOTEXTMODE); 1045 fp = _Py_fopen(filename, "r" PY_STDIOTEXTMODE);
1046 return err_programtext(fp, lineno); 1046 return err_programtext(fp, lineno);
1047 } 1047 }
1048 1048
1049 PyObject * 1049 PyObject *
1050 PyErr_ProgramTextObject(PyObject *filename, int lineno) 1050 PyErr_ProgramTextObject(PyObject *filename, int lineno)
1051 { 1051 {
1052 FILE *fp; 1052 FILE *fp;
1053 if (filename == NULL || lineno <= 0) 1053 if (filename == NULL || lineno <= 0)
1054 return NULL; 1054 return NULL;
1055 fp = _Py_fopen(filename, "r" PY_STDIOTEXTMODE); 1055 fp = _Py_fopen_obj(filename, "r" PY_STDIOTEXTMODE);
1056 return err_programtext(fp, lineno); 1056 return err_programtext(fp, lineno);
1057 } 1057 }
1058 1058
1059 #ifdef __cplusplus 1059 #ifdef __cplusplus
1060 } 1060 }