summaryrefslogtreecommitdiff
path: root/Programs
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
commite134a7fe36652434c2ccffc4ebab2ec2031d1505 (patch)
tree9eea060bf19c856881f438860eb2abdbe41f2bdd /Programs
parent2e1c4e5db2894ec4322f917e9babc4e37dca9244 (diff)
downloadcpython-git-e134a7fe36652434c2ccffc4ebab2ec2031d1505.tar.gz
Issue #23752: _Py_fstat() is now responsible to raise the Python exception
Add _Py_fstat_noraise() function when a Python exception is not welcome.
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_freeze_importlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c
index 31b3d31bd7..b72fcf486f 100644
--- a/Programs/_freeze_importlib.c
+++ b/Programs/_freeze_importlib.c
@@ -35,7 +35,7 @@ main(int argc, char *argv[])
{
char *inpath, *outpath;
FILE *infile = NULL, *outfile = NULL;
- struct _Py_stat_struct st;
+ struct _Py_stat_struct status;
size_t text_size, data_size, n;
char *text = NULL;
unsigned char *data;
@@ -54,11 +54,11 @@ main(int argc, char *argv[])
fprintf(stderr, "cannot open '%s' for reading\n", inpath);
goto error;
}
- if (_Py_fstat(fileno(infile), &st)) {
+ if (_Py_fstat_noraise(fileno(infile), &status)) {
fprintf(stderr, "cannot fstat '%s'\n", inpath);
goto error;
}
- text_size = st.st_size;
+ text_size = status.st_size;
text = (char *) malloc(text_size + 1);
if (text == NULL) {
fprintf(stderr, "could not allocate %ld bytes\n", (long) text_size);