diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 08:09:31 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 08:09:31 (GMT) |
commit | e134a7fe36652434c2ccffc4ebab2ec2031d1505 (patch) | |
tree | 9eea060bf19c856881f438860eb2abdbe41f2bdd /Programs | |
parent | 2e1c4e5db2894ec4322f917e9babc4e37dca9244 (diff) | |
download | cpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.zip cpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.tar.gz cpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.tar.bz2 |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c index 31b3d31..b72fcf4 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); |